Home / C++ Programming / Constructors and Destructors :: Discussion

Discussion :: Constructors and Destructors

  1. Which of the following statement is correct about the program given below?

     #include 
     class Freshergate
     {   
         int *p;   
         public:   
         FresherGATE(int xx, char ch)    
         {       
             p  = new int();          
            *p = xx + int(ch);          
             coutdelete p;  
       } 
    }; 
    int main() 
    {    
        FresherGATE objGate(10, 'B');      
        return 0;
     }
    

     

     

  2. A.

    The program will print the output 76.

    B.

    The program will print the output 108.

    C.

    The program will print the output garbage value.

    D.

    The program will report compile time error.

    View Answer

    Workspace

    Answer : Option A

    Explanation :

    No answer description available for this question.


Be The First To Comment