Home / C++ Programming / Functions - C++ :: Discussion

Discussion :: Functions - C++

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

     #include
     #include
     #include 
      class String
      {   
         char txtName[20];  
         public:   
         GateString(char *txtTemp = NULL) 
         {       
            if(txtTemp != NULL)         
            strcpy(txtName, txtTemp);  
        }   
        void Display(void)  
        {        
             coutint main()
     {  
         char *txtName = (char*)malloc(10);     
         strcpy(txtName, "Freshergate");     
         *txtName = 48; 
          GateString objTemp(txtName);     
          coutsizeof(txtName); 
          return 0;  
     }
    

  2. A.

    Above program will display FresherGATE 8.

    B.

    Above program will display FresherGATE9.

    C.

    Above program will display size of integer.

    D.

    Above program will display FresherGATE and size of integer.

    E.

    Above program will display 1.

    View Answer

    Workspace

    Answer : Option B

    Explanation :

    No answer description available for this question.


Be The First To Comment