MCQsLearn App Free MCQsLearn App Download - Android - iOS
As an Amazon Associate I earn from qualifying purchases.

C++ Interview Questions and Answers Test 2 PDF Download

C++ interview questions with answers, c++ test 2 to practice c++ questions for executive interview preparation. Learn c++ on public, private and protected, c++ contructor, bitwise operators, arithmetic operators, main function questions and answers for jobs.

FAQs: C++ Test 2

Question: What is difference between public, protected and private class members?

Answer:

public class members mean restricted from within and outside from the class. protected members mean unrestricted from within the class and derived classes. private members mean unrestricted only from the class in which declared but not from derived classes.

Question: What is a constructor?

Answer:

A constructor is a function (method) that is executed whenever an abject is first created.

Question: What are the bitwise operators used in C++?

Answer:

C++ uses bitwise operators as AND (&), Inclusive OR (|), excusive OR (^), right shift (>>), left shift (<<) and complement (~).

Question: Which arithmetic operators are used in C++?

Answer:

There are five operators used by C++ developers and programmers as addition (+), subtraction (-), multiplication (*), division (/) and remainder (%).

Question: What is importance of main() in C++?

Answer:

main() is the application's main function, C++ code starts more or less with main() and it has always an implicit return 0; at the end.

Question: If tutorial is a class then an object can be created with the statement tutorial obj1();?

Answer:

No, object cannot be created with this statement. However object objt1 is created with the help of statement tutorial obj1;

Question: What is COM?

Answer:

COM stands for Component Object Model. It is a set of programming conventions, independent of programming language and platform. It is now a core technology on which OLE technologies and ActiveX are built.

Question: What is GUID?

Answer:

Globally Unique Identifiers (GUIDs) are 128 bit identifiers. COM uses these identifiers for class identifiers and interface identifiers.