Posts

Showing posts from October, 2021

Interview questions

Orion Innovations class A {           public:     A()     {         printf("A def ctor\n");     }     ~A()     {         printf("~A def dector\n");     }     char ac; }; static A statObject; int main() {     printf("Size of A = %d\n", sizeof(A));     printf("main()\n"); } //===================== //output: here // A def ctor Size of A = 1 main() ~A def dector struct A {     A() { cout << "A" << endl; }     ~A() { cout << "~A" << endl; } }; struct B {     B() { cout << "B" << endl; }     ~B() { cout << "~B" << endl; } }; struct D {     D( D& d ) { cout << "&D" << endl; }     D() { cout << "D" <...