1. Types of templates. (2)
2. Order of function resolution. (2)
3. Virtual Inheritance, use, example. (5)
4. Diamond Problem. (5)
5. Write C++ code that uses try catch block in member initialization list of any class.
6. Got more questions of coding, corrections, and output.
Wrote these down. Others took more of my time to code. Couldn't write them.
class c1 {
public: int i_c1;
c1( ) : i_c1 ( 0 ) { }
};
class c2 : public c1 {
public: int i_c2;
c2( ) : i_c2 ( 0 ) { }
};
class c3 : public c1 {
public: int i_c3;
c3( ) : i_c3 ( 0 ) { }
};
Code was something like this and had to find the error in the code.
7. Find error, give reason, correct. (5)
class Base { };
class Derived : public Base { };
Base * base1 = new Base();
Derived * derived1 = new Derived();
Derived * derived2 = new Base(); // here is the error
2. Order of function resolution. (2)
3. Virtual Inheritance, use, example. (5)
4. Diamond Problem. (5)
5. Write C++ code that uses try catch block in member initialization list of any class.
6. Got more questions of coding, corrections, and output.
Wrote these down. Others took more of my time to code. Couldn't write them.
class c1 {
public: int i_c1;
c1( ) : i_c1 ( 0 ) { }
};
class c2 : public c1 {
public: int i_c2;
c2( ) : i_c2 ( 0 ) { }
};
class c3 : public c1 {
public: int i_c3;
c3( ) : i_c3 ( 0 ) { }
};
Code was something like this and had to find the error in the code.
7. Find error, give reason, correct. (5)
class Base { };
class Derived : public Base { };
Base * base1 = new Base();
Derived * derived1 = new Derived();
Derived * derived2 = new Base(); // here is the error
Comments
Post a Comment
Please give us your feedback & help us to improve this site.