Skip to content

Tag Archives: CPP-Functions

The definition CPP void main() { /* ... */ } is not and never has been C++, nor has it even been C. See the… Read More
Predict the output of following C++ program. #include <iostream> using namespace std; int main(int a) {     cout << a << "\n";     return 0; } int… Read More
If we have a function in base class and a function with same name in derived class, can the base class function be called from… Read More
In C++, virtual functions can be private and can be overridden by the derived class. For example, the following program compiles and runs fine. C++… Read More
Predict the output of following C++ program. #include<iostream> using namespace std;    class Test { protected:     int x; public:     Test (int i):x(i) { }     void… Read More
In C++ and Java, functions can not be overloaded if they differ only in the return type. For example, the following program C++ and Java… Read More