Question 1
Question 2
Which of the following is not correct for virtual function in C++ ?
Must be declared in public section of class.
Virtual function can be static.
Virtual function should be accessed using pointers.
Virtual function is defined in base class.
Question 3
Which of the following is not correct (in C++) ?
(1)
(2), (4)
(2), (3), (4)
(4)
Question 4
Question 5
#include<iostream>
using namespace std;
int x = 1;
void fun()
{
int x = 2;
{
int x = 3;
cout << ::x << endl;
}
}
int main()
{
fun();
return 0;
}
1
2
3
0
Question 6
Question 7
#include <iostream>
#include <vector>
using namespace std;
class a
{
public :
~a()
{
cout << "destroy";
}
};
int main()
{
vector <a*> *v1 = new vector<a*>;
vector <a> *v2 = new vector<a>;
return 0;
}
Question 8
#include<iostream>
using namespace std;
int x[100];
int main()
{
cout << x[99] << endl;
}
Question 9
Question 10
There are 15 questions to complete.