Category: C++ Basic

C++ Basic interview questions and answers with example asked in IT Industries. List of C++ interview questions or for freshers and experienced both | Only Real.

Can static function access non static variables in C++?

No, Static function of a class in C++ cannot access non-static variables, but, it can access static variable only. However, non-static member function can access static and non-static variable both. Static function is not associated with class object, means without object using class name only it can be called. whereas non-static variables are associated with…

Read the full article

Which is called first constructor or overloaded new operator in C++?

Interview Question: A C++ class has constructor and overloaded new and delete operator function. If we create a class object dynamically using new then out of constructor and overloaded new operator function, which one get called first? Recommended to read a simple program with important important points of new and delete operator overloading in C++…

Read the full article

What is constructor overloading in C++ – Short and Easy

Constructor overloading in C++ programming is same as function overloading. When we create more that one constructors in a class with different number of parameters or different types of parameters or different order of parameters, it is called as constructor overloading. In sample words, writing multiple constructors in a class is known as constructor overloading…

Read the full article