Functions

Q1: Which of the following statement is correct about the program given below?
#include<iostream.h>
#include<string.h>
#include<malloc.h>
class AptitudeString
{
    char txtName[20]; 
    public:
    AptitudeString(char *txtTemp = NULL)
    {
        if(txtTemp != NULL)
        strcpy(txtName, txtTemp);
    }
    void Display(void)
    {
        cout<<txtName;
    }
};
int main()
{
    char *txtName = (char*)malloc(10);
    strcpy(txtName, 'AptitudeCrack');
    *txtName = 48;
    AptitudeString objTemp(txtName);
    cout<< sizeof(txtName);
    return 0; 
}

A Above program will display AptitudeCrack 9.

B Above program will display AptitudeCrack 8.

C Above program will display 1.

D Above program will display AptitudeCrack and size of integer.

E Above program will display size of integer.

ANS:B - Above program will display AptitudeCrack 9.

No answer description is available. Let's discuss.



img not found
img

For help Students Orientation
Mcqs Questions

One stop destination for examination, preparation, recruitment, and more. Specially designed online test to solve all your preparation worries. Go wherever you want to and practice whenever you want, using the online test platform.