Home » C++ » MCQs for Experts
Page 2 (26 - 51)
Question: 26
(A) t.foo template<U>(u);
(B) t.foo<typename U>(u);
(C) t.template foo<U>(u);
(D) typename t.foo<U>(u);
Question: 27
(A) g++ -std=c++-11 -o output.out source.cpp
(B) g++ -std=c++11 -o output.out source.cpp
(C) g++ -std=c++ 11 -o output.out source.cpp
(D) g++ -std=cpp11 -o output.out source.cpp
Question: 28
(A) Filename
(B) First argument
(C) Last argument
(D) NULL pointer
Question: 29
(A) nmake -f myfile option
(B) nmake -f opiton myfile
(C) nmake option -f myfile
(D) nmake option -fname myfile
Question: 30
Question: 31
Question: 32
Question: 33
Question: 34
Question: 35
(A) ios::out | ios::in
(B) ios::out, ios::in
(C) ios::out || ios::in
(D) ios::out & ios::in
Question: 36
(A) g++ -o <filename>
(B) g++ -c <filename>
(C) g++ <filename>
(D) g++ -f <filename>
Question: 37
(A) Normal Data Section
(B) Un initialized data section
(C) Initialized data section
(D) None of the above
Question: 38
(A) std::variant
(B) std::optional
(C) std::string_view
(D) None of the above
Question: 39
Question: 41
Question: 42
Question: 43
Question: 44
Question: 45
(A) std::thread threadObj(thread_function);
(B) std::thread threadObj(&thread_function);
(C) std::thread threadObj((void *)thread_function);
(D) std::thread threadObj(thread_function());
Question: 46
Question: 47
Question: 48
Question: 49
(A) We can't transfer the ownership of unique pointers
(B) It is possible using copy constructor - unique_ptr<Thing> ptr2(ptr1);
(C) ptr2 = std::move(ptr1);
(D) ptr2 = ptr1
Question: 50
Question: 51
(A) Compilation Error
(B) 10, 20
(C) 10, 10
(D) 10, Undfefined Value
C++ Online Test
Compile C++ code here