50 CÂU HỎI
What is output?
A. LAPTRINHC++.NET
B. .NETLAPTRINHC++
C. Address of pstr[0] Address of pstr[1]
What is output? Giả sử dùng VC++ 2008 trên hệ điều hành 32 bit
A. 9
B. 12
C. 16
D. 24
What is output?
A. 20
B. 18
C. 32
D. 24
What is output?
A. ID=1009, dd/mm/yyyy = 16/09/1989
B. ID = 1009, dd/mm/yyyy = garbage value/garbage value/garbage value (garbage value: giá trị rác)
C. Error sytax (Lỗi cú pháp)
What is output?
A. laptrinhc++ 2
B. Complier error
C. Runtime error
What is output?
A. 4
B. Complier error
C. 8
What is output?
A. 16
B. 22
C. 32
D. 18
Which of the following operators can be applied on structure variables?
A. Equality comparison ( == )
B. Assignment ( = )
C. Both of the above
D. None of the above
What is output?
A. 21
B. 27
C. Complier Error
D. Another
What is output?
A. 530
B. 70
C. 40
D. Complier Error
What is output?
A. Y = 3
B. Y = 5
C. Garbage value
What is output?
A. C/C++
B. Java
C. Complier error
What is output?
A. C/C++
B. Java
C. Complier error
What is output?
A. 1
B. 36
C. 6
D. 30
What is output?
A. 10 50
B. 10 10
C. 50 50
What is output?
A. 1000
B. 100
C. Complier error
What is output?
A. ‘laptrinhc++’ is printed 3 times
B. ‘laptrinhc++’ is printed 2 times
C. Complier error
A ____ is a special member function used to initialize the data members of a class.
A. constructor
B. destructor
C. static method
The default access for members of a class is ___ .
A. private
B. public
C. protected
D. protect
Member functions of a class are normally made ___ and data members of a class are normally made ___ .
A. private, public
B. protected, public
C. public, private
D. public, protected
Inheritance enables ___ which saves time in development , and encourages using previously proven and high quality software.
A. reusability
B. encapsulation
C. development
The three member access specifiers are ___, ___ and ___ .
A. public, private, protected
B. public, private, protect
C. public, private, static
A “has a” relationship between classes represents ___ and an “is a” relationship between classes represent ___ .
A. containment, inheritance
B. hiding, inheritance
C. encapsulation, inheritance
A pure virtual function is specified by placing ___ at the end of its prototype in the class definition.
A. =0
B. =1
C. =-1
A operator ___ is called as de-referencing operator.
A. &
B. *
C. &&
The size of a class with no data members and member functions is ___ bytes
A. 0
B. 1
C. 4
A class is called as abstract base class if it has a ___ function
A. pure virtual
B. static
C. private
Run-time or dynamic allocation of memory may be done using the C++ operator ___ .
A. new
B. alloc
C. malloc
Operator overloading permits to extend the applicability of existing C++ operators so that they work with new ___ or ___.
A. data types, objects
B. data types, constant
C. data types, pointer
A ___ is a set of instance or values.
A. class
B. object
C. function
C++ programming language was designed and developed by ___ at ___.
A. Steven Job, AT&T Bell Labs
B. Bjarne Stroustrup, AT&T Bell Labs
C. Guido van Rossum, M&D Lab
C++ is a ___ programming language with ___ extensions.
A. procedural, object oriented
B. object, procedural
C. procedural, STL
Pointers are ___ that contain the addresses of other variables and ____ .
A. value, object
B. object, class
C. variables, functions
A program can use the address of any variable in an expression, except variables declared with the ___ storage class.
A. static
B. register
C. auto
New operator allocates memory blocks from the ___.
A. Stack
B. Heap
C. Register
The new operator throws a ___ when heap is exhausted.
A. runtime exception
B. syntax error
C. logic error
The (assert.h) header is used for ___ .
A. debugging
B. checking memory leak
C. library for time
The constructor and destructor of a class in C++ are called ___
A. automatically
B. manually
C. none of above
Two or more functions may have the same name, as long as their ___ are different.
A. return type
B. parameter lists
C. none of above
A constructor with default arguments for all its parameters is called a ___ constructor.
A. static
B. run-time
C. default
Run time polymorphism is ___ than the compile time polymorphism.
A. dynamic
B. static
C. public
The two types of polymorphism is : ____ & ____ .
A. Run time and compile time
B. Preprocessor, compile time
C. Preprocessor, Linker
A file stream is an extension of a ___ stream.
A. console
B. windows
C. none of above
The Standard Template Library(STL) is a library of ___ templates.
A. container class
B. time class
C. none of above
Run time polymorphism is ___ than the compile time polymorphism.
A. less flexible
B. more flexible
C. none of above
With private inheritance, public and protected members of the base class become ___ members of the derived class.
A. private
B. public
C. protected
The STL Container adapters contains the ___ , ___ and ___ STL containers.
A. Stack, Queue, Priority_queue
B. Set, Multiset, Map
C. vectors, lists, deques
The ___ block contains code that directly or indirectly might cause an exception to be thrown.
A. catch
B. try
C. none of above
When writing function or class template, one use a ___ to specify a generic data type.
A. template parameters
B. keyword
C. none of above
Data items in a class may be public.
A. TRUE
B. FALSE