Predict the output of following C++ program
#include<iostream>
using namespace std;
class Empty {};
int main()
{
cout << sizeof(Empty);
return 0;
}
1 Crore+ students have signed up on EduRev. Have you? Download the App |
Which other keywords are also used to declare the class other than class?
Which of the following is true about the following program
#include <iostream>
class Test
{
public:
int i;
void get();
};
void Test::get()
{
std::cout << "Enter the value of i: ";
std::cin >> i;
}
Test t; // Global object
int main()
{
Test t; // local object
t.get();
std::cout << "value of i in local t: "<<t.i<<'n';
::t.get();
std::cout << "value of i in global t: "<<::t.i<<'n';
return 0;
}
Which of the following is not correct for virtual function in C++ ?
When struct is used instead of the keyword class means, what will happen in the program?
Which of the following cannot be passed to a function in C++ ?
73 videos|7 docs|23 tests
|