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