1. What is C++ ?
C++ is a statically typed, compiled, general-purpose programming language that supports procedural, object-oriented, and generic programming features.
2. Why is C++ used?
It's widely used for developing complex systems where hardware level manipulation is needed, such as operating systems, game engines, and enterprise software.
3. What are the primitive data types in C++?
Primitive data types are built-in or predfined data types and can be used directly by the user to declare variables.
4. What is a namespace in C++ and how is it used?
In C++, a namespace is a way to organize and encapsulate code to prevent naming conflicts. It's declared using the namespace keyword, and entities within it are accessed using the scope resolution operator ::
5. How does static affect global/local variables?
In C++, static affects global variables by limiting their visibility to the current source file. For local variables, static changes their storage duration.
6. What is the friend function in ?++.
In C++, the Friend function is defined as the creative function capable of retrieving the private and protected data of a class. We define a friend function employing the friend keyword within the structure of the class.
7. What is operator overloading?
Operator overloading is a type of polymorphism within which a function is employed to overload or modifies the majority of the operators accessible in C++.
8. What do you understand by reference in C++?
A reference in C++ denotes the address of the unique variable and is built through the ampersand (&) operator. It is used when you want to have two distinct names indicating the same variable.
9. What is the token in C++?
Tokens are the smallest component in a C++ program. It’s a collection of characters that logically or rationally, are connected. It signifies a substantial unit of code and operates as a foundation inside the syntax rules and program structure.
10. What are the types of polymorphism in C++?
Compile-time Polymorphism resolved during compile-time, includes function overloading and operator overloading. And run-time polymorphism which resolved during run-time, includes virtual functions and function overriding.
11. What are void pointers in C++?
In C++, A void pointer is a pointer that does not have any associated data type with it.
12. What do you mean by destructors in C++?
Destructor is an object member method that is executed implicitly each time an instance is about to be destroyed.
13. What is abstract class?
An abstract class in C++ is a class that cannot be instantiated directly and is designed to serve as a base for other classes.
14. What is virtual function in C++?
A virtual function in C++ is a member function of a class that is declared with the virtual keyword and can be overridden in derived classes.
15. What does the inline keyword mean?
The inline keyword in C++ is a specifier used to suggest that a function should be expanded inline by the compiler, rather than being called as a separate function.
16. What is a delegating constructor?
A delegating constructor in C++ is a constructor within a class that calls another constructor of the same class to perform part of its initialization.
17. What is an initializer list?
An initializer list in C++ is a way to initialize the data members of an object or invoke the constructors of its base classes in the constructor initialization list.
18. What is STL?
The Standard Template Library (STL) is a collection of generic algorithms and data structures provided as a part of the C++ Standard Library.
19. What is the friend keyword?
The friend keyword in C++ is used to grant access to private and protected members of a class to other classes or functions.
20. What is a functor in C++?
In C++, a functor, also known as a function object, is any object that can be used as if it were a function. This is achieved by overloading the operator() of a class.
21. What is lvalue?
In C++, an lvalue refers to an expression that represents an object that occupies some identifiable location in memory (i.e., it has a name).
22. What is an rvalue?
An rvalue refers to an expression that represents a value rather than a memory location, typically appearing on the right-hand side of an assignment expression.
23. Can you compile a program without the main function?
Yes, you can compile a program without the main function.
24. Is it possible to overload a deconstructor?
No, it is impossible as destructors do not take arguments or return anything.
25. What is inheritance?
Inheritance is the mechanism in which you can create a new class i.e. child class from the existing class i.e. parent class.
26. What is the use of the indentation in c++?
To distinguish between different parts of the program like comments, codes, etc.
27. Which keyword is used to define the macros in c++?
#define is the keyword that is used to define the macros in c++.
Share this protal to share friends and complete unlimited tests here. You can also make friends on our protal also start mutual competition tests with your firends easily.