80% Mcq’s were from past papers
Give the basic difference between cursor and Iterator?
What do you mean by stack unwinding?
Can we make constructor Virtual?
What is Graceful Termination? Give an example.
In both virtual inheritance and multiple inheritance copy/copies of base class are created, List down how many copy/copies are created for:
virtual inheritance
Multiple inheritance
What would be the output of this code?
class mother {
public:
mother ()
{ cout "mother: no parameters\n"; }
mother (int a)
{ cout "mother: int parameter\n"; }
};
class daughter : public mother {
public:
daughter (int a)
{ cout "daughter: int parameter\n\n"; }
};
class son : public mother {
public:
son (int a) : mother (a)
{ cout "son: int parameter\n\n"; }
};
int main () {
daughter rabia (0);
son salman(0);
return 0;
}
The code given below has one template function as a friend of a template class,
- You have to identify any error/s in this code and describe the reason for error/s.
- Give the correct code after removing the error/s.
void Test(U);
template< class T >
class B {
int data;
public: friend void Test<>( T );
};
template<typename U>
void Test(U u){
B < int> b1;
b1.data = 7;
}
int main(int argc, char *argv[])
{
char i;
Test(i);
system("PAUSE");
return 0;
};
Describe three properties necessary for a container to implement Generic Algorithms.
Comments
Post a Comment
Please give us your feedback & help us to improve this site.