Home C C++ Java Python Perl PHP SQL JavaScript Linux Online Test Forum

Home » C++ » C++ Objective Questions for Practitioners

C++ Objective Questions for Practitioners : 116


Question: 1

(A) Yes
(B) No
(C) Undefined
(D) Depends on Compiler

Compiler Forum
Practitioner datatype[Posted by: Admin | Chicago, USA]



Question: 2

(A) 5020--5020--
(B) 5020--7012020--12020--
(C) 5020--70120200--5020
(D) 5020--7050200--5020--

Compiler Forum
Practitioner function[Posted by: Admin | Chicago, USA]



Question: 3

(A) Error
(B) 5 times
(C) 4 times
(D) 6 times

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 4

(A) read()
(B) write()
(C) both A and B
(D) without read()

Compiler Forum
Practitioner operators[Posted by: Admin | Chicago, USA]



Question: 5

(A) *
(B) /
(C) %
(D) all have same precedence

Compiler Forum
Practitioner operators[Posted by: Admin | Chicago, USA]



Question: 6

(A) One
(B) Compilation Error
(C) Default
(D) OneTwoThree

Compiler Forum
Practitioner conditional[Posted by: Admin | Chicago, USA]



Question: 7

(A) A class with abstract keyword
(B) A class with no functions in it
(C) A class with atleast one pure virtual function
(D) Empty Class

Compiler Forum
Practitioner polymorphism[Posted by: Admin | Chicago, USA]



Question: 8

(A) 0
(B) 1
(C) 2
(D) 4

Compiler Forum
Practitioner datatype[Posted by: Admin | Chicago, USA]



Question: 9

(A) Yes
(B) No

Compiler Forum
Practitioner datatype[Posted by: Admin | Chicago, USA]



Question: 10

(A) Yes
(B) No

Compiler Forum
Practitioner datatype[Posted by: Admin | Chicago, USA]



Question: 11

(A) We cant have
(B) In different work space
(C) Can have but in different file
(D) We can have in any scenario

Compiler Forum
Practitioner datatype[Posted by: Admin | Chicago, USA]



Question: 12

(A) Yes
(B) No

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 13

(A) It is not possible
(B) It is possible only with C code
(C) By using extern "C" keyword
(D) By Converting C++ code to C

Compiler Forum
Practitioner function[Posted by: Admin | Chicago, USA]



Question: 14

(A) Yes
(B) No

Compiler Forum
Practitioner abstract_class[Posted by: Admin | Chicago, USA]



Question: 15

(A) Yes
(B) No

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 16

(A) Yes
(B) No

Compiler Forum
Practitioner abstract_class[Posted by: Admin | Chicago, USA]



Question: 17

(A) Yes
(B) No

Compiler Forum
Practitioner classesAndobjects[Posted by: Admin | Chicago, USA]



Question: 18

(A) It contains VPTR
(B) It contains address of Virtual function
(C) It cotains address of Object
(D) None of these

Compiler Forum
Practitioner vtable[Posted by: Admin | Chicago, USA]



Question: 19

(A) Yes
(B) No

Compiler Forum
Practitioner classesAndobjects[Posted by: Admin | Chicago, USA]



Question: 20

(A) A pointer pointing to NULL
(B) Pointer pointing to memory location which has been freed
(C) Pointer which is pointing to new location
(D) None of these

Compiler Forum
Practitioner pointers[Posted by: Admin | Chicago, USA]



Question: 21

(A) Yes
(B) No

Compiler Forum
Practitioner virtual_func[Posted by: Admin | Chicago, USA]



Question: 22

(A) Yes
(B) No
(C) Depends on compiler

Compiler Forum
Practitioner virtual_func[Posted by: Admin | Chicago, USA]



Question: 23

(A) Yes
(B) No

Compiler Forum
Practitioner virtual_func[Posted by: Admin | Chicago, USA]



Question: 24

(A) Yes
(B) No

Compiler Forum
Practitioner virtual_func[Posted by: Admin | Chicago, USA]



Question: 25

(A) Yes
(B) No

Compiler Forum
Practitioner virtual_func[Posted by: Admin | Chicago, USA]



Question: 26

(A) Yes
(B) No

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 27

(A) AVL Tree
(B) Binary Tree
(C) Balance Binary Tree
(D) None of these

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 28

(A) Vector
(B) Deque
(C) Stack
(D) List

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 29

(A) We can create n number of object
(B) We can create max 256 objects
(C) We can create 1 object
(D) We cant create object

Compiler Forum
Practitioner classesAndobjects[Posted by: Admin | Chicago, USA]



Question: 30

(A) A
(B) B
(C) Both has are same
(D) Depends on Compiler

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 31

(A) Structure which contains pointers
(B) Structure which has pointer to itself
(C) Structure which contains another structure
(D) None of these

Compiler Forum
Practitioner structure[Posted by: Admin | Chicago, USA]



Question: 32

(A) Hello
(B) Bye
(C) Undefined
(D) Compilation Error

Compiler Forum
Practitioner conditional[Posted by: Admin | Chicago, USA]



Question: 33

(A) 01
(B) 012
(C) 0
(D) 0123

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 34

(A) FiveSix
(B) Five
(C) Six
(D) None of these

Compiler Forum
Practitioner conditional[Posted by: Admin | Chicago, USA]



Question: 35

(A) c1=-7,c2=-4
(B) c1=-7,c2=-3
(C) c1=-4,c1=b-3
(D) c1=-6,c2=-6

Compiler Forum
Practitioner operators[Posted by: Admin | Chicago, USA]



Question: 36

(A) 1@2@
(B) 1@2@1@
(C) 1@1@2@
(D) 1@2@2@

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 37

(A) std::bad_typeid
(B) std::logic_error
(C) std::runtime_error
(D) std::bad_cast

Compiler Forum
Practitioner dynamic_cast[Posted by: Admin | Chicago, USA]



Question: 38

(A) std::bad_exception
(B) std::logic_error
(C) std::exception
(D) std::runtime_error

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 39

(A) .exe
(B) .out
(C) .lib
(D) .a

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 40

(A) IS-A relation
(B) HAS-A relation
(C) None of these

Compiler Forum
Practitioner classesAndobjects[Posted by: Admin | Chicago, USA]



Question: 41

(A) Yes
(B) No
(C) Depends on compiler
(D) None of these

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 42

(A) ASM
(B) asm
(C) Not possible
(D) Compiler specific

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 43

(A) Hey..
(B) CppBuzz.com
(C) Compilation Error
(D) None of these

Compiler Forum
Practitioner conditional[Posted by: Admin | Chicago, USA]



Question: 44

(A) 1 Million +
(B) 2 Million +
(C) 3 Million +
(D) 4 Million +

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 45

(A) True
(B) False

Compiler Forum
Practitioner other[Posted by: | Chicago, USA]



Question: 46

(A) do
(B) sizeof()
(C) goto
(D) sqrt()

Compiler Forum
Practitioner keyword[Posted by: Admin | Chicago, USA]



Question: 47

(A) pragma
(B) override
(C) wchar_t
(D) mutable

Compiler Forum
Practitioner cpp11[Posted by: Admin | Chicago, USA]



Question: 48

(A) It makes variable constant
(B) There is no such keyword in C++
(C) It allows a class data member to be modified even though it is the data member of a const object
(D) None of these

Compiler Forum
Practitioner keyword[Posted by: Admin | Chicago, USA]



Question: 49

(A) It saves the memory
(B) It runs code faster by allocating varibales in CPU register
(C) It takes extra bytes of memory
(D) Register variable are used with high configuration machines

Compiler Forum
Practitioner keyword[Posted by: Admin | Chicago, USA]



Question: 50

(A) Yes
(B) No

Compiler Forum
Practitioner keyword[Posted by: Admin | Chicago, USA]



Question: 51

(A) It is volatile because it can change at any time
(B) It is const because our C program must not try to modify it
(C) Change value outside by means outside our C program
(D) All of these

Compiler Forum
Practitioner keyword[Posted by: Admin | Chicago, USA]



Question: 52

(A) It saves memory
(B) It releases memory once it go out of scope
(C) It inrease execution time of program
(D) None of these

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 53

(A) ios::trunc
(B) ios::ate
(C) ios::app
(D) ios::tellg

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 54

(A) blue
(B) 2
(C) 1
(D) None of these

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 55

(A) blue
(B) Compilation Error
(C) 1
(D) 2

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 56

(A) yellow
(B) black
(C) Compilation Error
(D) 3

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 57

(A) black
(B) 0
(C) -1
(D) Some Garbage Value

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 58

(A) 0
(B) 1
(C) 2
(D) 4

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 59

(A) Compilation Error
(B) 0
(C) 1
(D) -4

Compiler Forum
Practitioner enum[Posted by: Admin | Chicago, USA]



Question: 60

(A) 128
(B) 256
(C) 1024
(D) None of the above

Compiler Forum
Practitioner structure[Posted by: Admin | Chicago, USA]



Question: 61

(A) int
(B) float
(C) class
(D) enum

Compiler Forum
Practitioner structure[Posted by: Admin | Chicago, USA]



Question: 62

(A) Yes
(B) No

Compiler Forum
Practitioner structure[Posted by: Admin | Chicago, USA]



Question: 63

(A) Yes
(B) No

Compiler Forum
Practitioner structure[Posted by: Admin | Chicago, USA]



Question: 64

(A) :?
(B) ::
(C) ->
(D) .

Compiler Forum
Practitioner namespace[Posted by: Admin | Chicago, USA]



Question: 65

(A) namespace::a
(B) namesspace.a
(C) namespace->a
(D) namespace:a

Compiler Forum
Practitioner namespace[Posted by: Admin | Chicago, USA]



Question: 66

(A) ios :: out
(B) ios :: app
(C) ios :: in
(D) ios::end

Compiler Forum
Practitioner filehandling[Posted by: Admin | Chicago, USA]



Question: 67

(A) Moves get pointer (input) to a specified location
(B) Moves put pointer (output) to a specified location
(C) Gives the current position of the get pointer
(D) Gives the current position of the put pointer

Compiler Forum
Practitioner filehandling[Posted by: Admin | Chicago, USA]



Question: 68

(A) Moves get pointer (input) to a specified location
(B) Moves put pointer (output) to a specified location
(C) Gives the current position of the get pointer
(D) Gives the current position of the put pointer

Compiler Forum
Practitioner filehandling[Posted by: Admin | Chicago, USA]



Question: 69

(A) Moves get pointer (input) to a specified location
(B) Moves put pointer (output) to a specified location
(C) Gives the current position of the get pointer
(D) Gives the current position of the put pointer

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 70

(A) Gives the current position of the put pointer
(B) Gives the current position of the get pointer
(C) Moves put pointer (output) to a specified location
(D) Moves get pointer (input) to a specified location

Compiler Forum
Practitioner filehandling[Posted by: Admin | Chicago, USA]



Question: 71

(A) QT
(B) SDL
(C) WxWidget
(D) Bootstrap

Compiler Forum
Practitioner other[Posted by: Admin | Chicago, USA]



Question: 72

(A) 9876543210
(B) 987654321
(C) 9
(D) 0

Compiler Forum
Practitioner loops[Posted by: Admin | Chicago, USA]



Question: 73

(A) 0
(B) 1
(C) 2
(D) error

Compiler Forum
Practitioner classesAndobjects[Posted by: Rohit Iparkar | Pune]



Question: 74

(A) std::vector<integer> vecOfInts;
(B) std::vector int <vecOfInts>
(C) std::vector(int) vecOfInts;
(D) std::vector<int> vecOfInts;

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 75

(A) Initialize a Vector with 5 int & all default value is 0
(B) Initialize a Vector with 5 int
(C) Initialize a Vector with 5 int & all default values will be garbage
(D) Initialize a Vector with 5 int & All default value with be -1

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 76

(A) Yes
(B) No

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 77

(A) Yes
(B) No

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 78

(A) 1 2 3 4
(B) 1234
(C) 12340
(D) 01234

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 79

(A) Initialize vect to 5 string with value "Hi"
(B) Initialize vect's first element to a string with value "Hi" & prints them
(C) Initialize vect to 1 string with value "Hi" & prints only one
(D) Initialize vect to 5 string with value "Hi" & prints them

Compiler Forum
Practitioner stl[Posted by: Admin | Chicago, USA]



Question: 80

(A) file.open(“c:filename.txt”);
(B) open(afile) = link(anObject);
(C) linkstream(“filenemae.txt”)
(D) link(open(filename.txt);

Compiler Forum
Practitioner filehandling[Posted by: Andrew | New Jersey]



Question: 81

(A) TRUE
(B) FALSE

Compiler Forum
Practitioner filehandling[Posted by: Andrew | New Jersey]



Question: 82

(A) At the end of the file
(B) At the beginning of the file
(C) Nonexistent until the program declares it
(D) There is no read position

Compiler Forum
Practitioner filehandling[Posted by: Andrew | New Jersey]



Question: 83

(A) The programs runs with no output
(B) 77
(C) Hello!
(D) Hello!

Compiler Forum
Practitioner classesAndobjects[Posted by: Andrew | New Jersey]



Question: 84

(A) True
(B) False

Compiler Forum
Practitioner classesAndobjects[Posted by: Andrew | New Jersey]



Question: 85

(A) #include
(B) #guard
(C) #ifndef
(D) endif

Compiler Forum
Practitioner other[Posted by: Andrew | New Jersey]



Question: 86

(A) True
(B) False

Compiler Forum
Practitioner operators[Posted by: Andrew | New Jersey]



Question: 87

(A) re-assigned
(B) reformatted
(C) constructed
(D) overloaded

Compiler Forum
Practitioner operators[Posted by: Andrew | New Jersey]



Question: 88

(A) True
(B) False

Compiler Forum
Practitioner operators[Posted by: Andrew | New Jersey]



Question: 89

(A) True
(B) False

Compiler Forum
Practitioner classesAndobjects[Posted by: Andrew | New Jersey]



Question: 90

(A) static
(B) auto
(C) exterb
(D) register

Compiler Forum
Practitioner classesAndobjects[Posted by: Andrew | New Jersey]



Question: 91

(A) Static function
(B) constructor
(C) destructor
(D) friend

Compiler Forum
Practitioner function[Posted by: Andrew | New Jersey]



Question: 92

(A) Any time you read or write to the file
(B) Never
(C) Only when reading from the file
(D) When opening the file stream

Compiler Forum
Practitioner filehandling[Posted by: Andrew | New Jersey]



Question: 93

(A) True
(B) False

Compiler Forum
Practitioner operators[Posted by: Andrew | New Jersey]



Question: 94

(A) True
(B) False

Compiler Forum
Practitioner classesAndobjects[Posted by: Andrew | New Jersey]



Question: 95

(A) True
(B) False

Compiler Forum
Practitioner pointers[Posted by: Andrew | New Jersey]



Question: 96

(A) Polymorphism
(B) Inheritance
(C) Function overloading
(D) None of these

Compiler Forum
Practitioner inheritance[Posted by: Andrew | New Jersey]



Question: 97

(A) virtual
(B) private
(C) public
(D) protected

Compiler Forum
Practitioner virtual_func[Posted by: Andrew | New Jersey]



Question: 98

(A) True
(B) False

Compiler Forum
Practitioner virtual_func[Posted by: Andrew | New Jersey]



Question: 99

(A) True
(B) False

Compiler Forum
Practitioner virtual_func[Posted by: Andrew | New Jersey]



Question: 100

(A) True
(B) False

Compiler Forum
Practitioner vtable[Posted by: Admin | Chicago, USA]



Question: 101

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 102

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 103

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 104

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 105

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 106

(A) True
(B) False

Compiler Forum
Practitioner typecasting[Posted by: Admin | Chicago, USA]



Question: 107

(A) True
(B) False

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 108

(A) True
(B) False

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 109

(A) True
(B) False

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 110

(A) True
(B) False

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 111

(A) Function declaration has error
(B) Behaviour is unknown
(C) Function will throw only standard exceptions defined in <exception>
(D) Function will not throw any exception

Compiler Forum
Practitioner exceptions[Posted by: Admin | Chicago, USA]



Question: 112

(A) Equal
(B) EqualEqual
(C) EqualNotEqual
(D) NotEqual

Compiler Forum
Practitioner conditional[Posted by: Admin | Chicago, USA]



Question: 113

(A) Program is terminated without printing anything on console
(B) Prints 'constructor' and then it is terminated
(C) constructor.destructor. but ptr is never freed
(D) constructor.destructor. And ptr is freed

Compiler Forum
Practitioner pointers[Posted by: Admin | Chicago, USA]



Question: 114

(A) C++11's weak_ptrs are used with shared_ptrs.
(B) C++11's weak_ptrs can be used without weak_ptrs
(C) C++11's weak_ptrs are replacement of unique_ptr
(D) C++11's weak_ptrs are used for unique ownership

Compiler Forum
Practitioner pointers[Posted by: Admin | Chicago, USA]



Question: 115

(A) We can only use these smart pointers to refer to objects allocated with new
(B) It is recommended that you do not use both 2 shared_ptr and raw pointer on the same object
(C) It can't be copied or assigned to another shared_ptr
(D) We can also reset a shared_ptr by assigning it the value nullptr

Compiler Forum
Practitioner pointers[Posted by: Admin | Chicago, USA]



Question: 116

(A) This is valid code snippet with no error
(B) Error: Copy construction is not allowed at line 2
(C) Error: Assignment is not allowed at line 2
(D) Error: Runtime exception

Compiler Forum
Practitioner pointers[Posted by: Admin | Chicago, USA]


Compile C++ code here Upload your Questions

Browse C++ Categories

Loops Conditional Functions Operators Structure Enum FileHandling Data Types Inheritance Pointers Classes & Objects Vtable Type Casting New & Delete Namespaces Reference Variables Virtual Functions Abstract Class STL Singleton Class Exceptions C++ 11 C++ 14 C++ 17 gcc/g++ others

Switch to C Questions