Home » C++ Programming » Functions

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

Correct Answer: Above program will display CuriousTab 9.

← Previous Question Next Question→

More Questions from Functions

Discussion & Comments

No comments yet. Be the first to comment!
Join Discussion