青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

李帥的博客

軟件開發愛好者

  C++博客 :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
  14 隨筆 :: 3 文章 :: 4 評論 :: 0 Trackbacks
9. Which of the following statements provide a valid reason NOT to use RTTI for distributed (i.e. networked between different platforms) applications in C++?
A. RTTI is too slow.
B. RTTI does not have standardized run-time behavior.
C. RTTI uses too much memory.
D. RTTI's performance is unpredictable/non-deterministic.
E. RTTI frequently fails to function correctly at run-time

11. A C++ developer wants to handle a static_cast <char*>() operation for the class String shown below. Which of the following options are valid declarations that will accomplish this task?
class String {
public:
  //...
  //declaration goes here
};
A. char* operator char*();
B. operator char*();
C. char* operator();
D. String operator char*();
E. char* operator String();


16. When a Copy Constructor is not written for a class, the C++ compiler generates one. Which of the following statements correctly describe the actions of this compiler-generated Copy Constructor when invoked?
A. The compiler-generated Copy Constructor makes the object being constructed, a reference to the object passed to it as an argument.
B. The compiler-generated Copy Constructor does not do anything by default.
C. The compiler-generated Copy Constructor performs a member-wise copy of the object passed to it as an argument, into the object being constructed.
D. The compiler-generated Copy Constructor tags the object as having been Copy-Constructed by the compiler.
E. The compiler-generated Copy Constructor invokes the assignment operator of the class.

17. Which of the following must be ensured in order to implement a polymorphic function in C++?
A.        There has to be a pointer of the derived class that has implemented the polymorphic function that holds the address of the derived class object.
B.        The function must be declared as virtual in both the base class and in the derived class that overrides the function.
C.        The function must be declared as pure virtual.
D.        There has to be a base class pointer holding the address of a base or derived class object that has implemented the polymorphic function.
E.        The function must be declared as virtual in the base class.

18. Protected, or private, inheritance, as opposed to public inheritance, models which type of relationship in C++?
A.        Can-only-have-one-of
B.        Is-implemented-in-terms-of
C.        Was-a
D.        Has-a
E.        Shares-a-relationship-with

19. Which of the following statements describe correct methods of handling C++ exceptions?
A.        Once an exception is thrown, the compiler unwinds the heap, freeing any memory dynamically allocated within the block from which the exception was thrown.
B.        In a hierarchy of exception classes, the order of handling exceptions can be from the most specific class to the most general class.
C.        Catching an exception by reference is preferable to catching it by value.
D.        If an exception is caught by its address or pointer, it is the responsibility of the thrower to release the memory occupied by the exception.
E.        To write an exception handler, it is essential to know the concrete class of exception to catch.

20. Which of the following statements regarding functions' default arguments in C++ are correct?
A.        Default arguments cannot be of a user-defined type.
B.        Default arguments exist in the global heap and not on the function's stack.
C.        Default arguments cannot be of pointer type.
D.        Default arguments can never precede non-default arguments.
E.        Default arguments are not considered for generating the function's signature.

21. Which of the following classes must be instantiated so that the object can be used both for reading and writing to the same file in C++?
A.        ofstream
B.        stream
C.        ifstream
D.        fstream
E.        iostream

22.  Which of the following reasons describe why a destructor cannot throw an exception in C++?
A.        Since the object is being destroyed, it is illogical to throw an exception then.
B.        A destructor may be invoked as a result of stack unwinding while an exception is being handled.
C.        It can invoke the terminate() handler.
D.        The C++ language does not permit it; a throw statement in a destructor will be caught as an error by the compiler.
E.        A destructor in C++ cannot implement a try...catch block

24. Which of the following identify const-correctness failures in the C++ program below?
template<typename T>
class MyArray
{
public:
    MyArray();
    MyArray(MyArray& copy);
    MyArray& operator=(MyArray& copy);
    //...

};

class MyData
{
public:
    MyData(MyArray<int>& x, MyArray<int>& y);
    //...

    const MyArray<int>& x();
    const MyArray<int>& y();
};

MyArray<int> read_data(int*, char**);
void make_changes(MyData* edit);

int main(int argc, char* argv[])
{
    const MyArray<int> read_x = read_data(&argc, argv);
    const MyArray<int> read_y = read_data(&argc, argv);
     
    MyData user_data(read_x, read_y);
    MyData edit_buffer(user_data);
    make_changes(&edit_buffer);
}

A.        MyData(MyArray<int>& x, MyArray<int>& y); should be
MyData(const MyArray<int>& x, const MyArray<int>& y);

B.        MyArray(MyArray& copy); should be
MyArray(const MyArray& copy);

C.        MyArray& operator=(MyArray& copy); should be
const MyArray& operator=(const MyArray& copy);

D.        void make_changes(MyData* edit); should be
void make_changes(const MyData* edit);

E.        const MyArray& operator=(const MyArray& copy); should be
const MyArray& operator=(const MyArray& copy) const;

25. Which of the following operators must be overloaded by function objects in the Standard Template Library?
A.        operator +()
B.        operator ==()
C.        operator ++()
D.        operator ()()
E.        operator []()

======================================================

附上我的選擇和疑問,歡迎大家指正和討論:

9. AD (not quite sure)
11. A (What does this question mean?! Can anyone explain it? )
16. AC  (Is A right?! Should it be 'a CONST reference to the object passed to it as an argument')
17. E (not quite sure. Is A or D right too? )
18. A or E. I have no idea at all!!!!
19 C (Is B right too?)
20. only D?
21. DE
22. BC ?
24. only B ?
25. D
posted on 2008-11-07 21:37 李帥 閱讀(1379) 評論(1)  編輯 收藏 引用

評論

# re: 幾道C++筆試題,不定項選擇,請高手解答分析,歡迎討論。 2011-09-21 17:55 臭美街
[url=http://www.choumeijie.com/]臭美街[/url]  回復  更多評論
  


只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            亚洲欧美久久久久一区二区三区| 亚洲免费激情| 久久久久91| 欧美一区二区三区精品| 国产亚洲在线观看| 狂野欧美一区| 欧美mv日韩mv国产网站| 亚洲看片一区| 亚洲一二三四久久| 国产欧美一区二区三区国产幕精品| 欧美中文字幕在线观看| 性欧美8khd高清极品| 激情亚洲成人| 亚洲精品乱码久久久久久蜜桃麻豆| 欧美精品在线一区二区| 亚洲午夜一区| 欧美在线一二三四区| 91久久久亚洲精品| 亚洲网址在线| 亚洲国产精品传媒在线观看| 亚洲激情亚洲| 国产酒店精品激情| 欧美黄免费看| 国产精品伦子伦免费视频| 久久久久久久久蜜桃| 欧美成人精品在线观看| 午夜精品成人在线| 久久亚洲私人国产精品va媚药| 99视频精品免费观看| 亚洲欧美一区二区三区在线| 亚洲精品视频一区二区三区| 亚洲调教视频在线观看| 在线欧美日韩国产| 亚洲一区二三| 亚洲免费福利视频| 久久成人人人人精品欧| 亚洲性感美女99在线| 久久精品人人做人人爽电影蜜月| 亚洲理论在线| 久久免费观看视频| 亚洲欧美资源在线| 欧美欧美在线| 欧美国产精品一区| 国产一区二区三区久久精品| 亚洲美女av电影| 亚洲国产精品久久久久久女王| 亚洲天天影视| 正在播放欧美一区| 欧美国产大片| 欧美 日韩 国产一区二区在线视频| 国产精品久久久久一区二区三区共 | 欧美激情一区二区久久久| 久久久久久9999| 国产女主播一区二区| 亚洲视频综合| 亚洲网站在线看| 欧美精品www| 亚洲国产精选| 亚洲精品美女在线观看播放| 久久五月天婷婷| 六月天综合网| 亚洲大胆人体视频| 久久精品国产亚洲精品| 久久国产免费| 国产综合久久久久久| 亚洲欧美春色| 久久久久久久久久久久久9999| 国产精品久久福利| 一本色道久久综合狠狠躁的推荐| 99综合在线| 欧美日韩国产成人在线| 日韩图片一区| 亚洲主播在线| 国产欧美一区二区三区在线老狼 | 久久精品夜夜夜夜久久| 久久成人在线| 国产视频观看一区| 久久国产99| 欧美高清视频在线播放| 亚洲国产精品悠悠久久琪琪| 免费在线欧美黄色| 亚洲美女av黄| 欧美一区二区三区视频| 韩日欧美一区二区三区| 久久综合999| 亚洲国产视频直播| 亚洲女同同性videoxma| 国产精品日韩欧美一区二区| 亚久久调教视频| 欧美高清视频在线| 在线亚洲欧美视频| 国产欧美日韩综合精品二区| 久久人人爽人人| 亚洲欧洲日本一区二区三区| 亚洲一品av免费观看| 国产老肥熟一区二区三区| 久久久另类综合| 日韩午夜精品| 久久亚洲一区二区三区四区| 亚洲久久一区二区| 国产精品一区二区久久国产| 久久国产日韩欧美| 99热精品在线| 久久久亚洲人| 亚洲色图综合久久| 曰韩精品一区二区| 欧美日韩视频| 老司机一区二区三区| 中国成人在线视频| 欧美岛国在线观看| 欧美综合二区| 在线天堂一区av电影| 伊人成人在线视频| 国产精品乱码久久久久久| 老司机亚洲精品| 亚洲欧美资源在线| 一本大道久久a久久精品综合| 久久亚洲精品网站| 午夜伦理片一区| 中日韩男男gay无套 | 欧美a级一区| 欧美一区二区三区的| 亚洲精品在线免费| 六月婷婷久久| 久久久激情视频| 亚洲欧美电影在线观看| 亚洲欧洲一级| 在线色欧美三级视频| 国产一区二区成人久久免费影院| 欧美日韩国产bt| 欧美高清不卡| 欧美激情1区| 老司机精品视频网站| 久久精品日韩欧美| 午夜亚洲福利| 亚洲欧美精品伊人久久| 亚洲图片欧洲图片日韩av| 9l国产精品久久久久麻豆| 欧美国产第一页| 欧美国产日韩亚洲一区| 欧美~级网站不卡| 欧美成人免费在线| 理论片一区二区在线| 久久精品国产亚洲精品| 欧美一区二区三区视频在线| 亚洲欧美激情在线视频| 亚洲资源av| 一区二区三区久久网| 在线亚洲欧美| 亚洲一区二区视频在线观看| 一区二区三区四区五区精品视频| 日韩视频在线一区二区三区| 亚洲人成人99网站| 一区二区不卡在线视频 午夜欧美不卡在| 亚洲精品美女| 亚洲视频一区二区| 午夜伦理片一区| 久久久国产精品一区二区中文 | 久久不射电影网| 久久超碰97人人做人人爱| 欧美一区二区三区在线看| 午夜亚洲福利| 久久综合色影院| 亚洲福利av| 亚洲图片自拍偷拍| 欧美一区二区三区在线看| 久久久精品日韩| 欧美片第1页综合| 国产精品系列在线| 国产综合色产| 亚洲免费久久| 性色一区二区| 欧美成人一区在线| 亚洲九九爱视频| 性色av一区二区三区在线观看| 久久精品国产久精国产爱| 欧美成在线视频| 国产精品一区二区视频| 伊人春色精品| 亚洲免费中文| 欧美国产一区二区在线观看| 亚洲深夜福利| 看欧美日韩国产| 国产精品免费网站| 亚洲国产第一| 欧美在线关看| 亚洲精品黄网在线观看| 亚洲嫩草精品久久| 欧美电影美腿模特1979在线看| 国产精品毛片在线看| 亚洲黄色尤物视频| 欧美亚洲一区二区在线| 欧美成人午夜77777| 亚洲欧美高清| 欧美日韩八区| 亚洲人久久久| 美女尤物久久精品| 亚洲在线成人| 国产精品h在线观看| 亚洲麻豆国产自偷在线|