Discussion :: Objects and Classes
-
What will be the output of the following program?
#include #include class FresherGate { char str[50]; char tmp[50]; public: FresherGate(char *s) { strcpy(str, s); } int GateFunction() { int i = 0, j = 0; while(*(str + i)) { if(* (str + i++) == ' ') *(tmp + j++) = *(str + i); } *(tmp + j) = 0; return strlen(tmp); } }; int main() { char txt[] = "Welcome to FresherGate.com!"; FresherGate objGate(txt); coutreturn 0; }
Answer : Option B
Explanation :
No answer description available for this question.
Be The First To Comment

Whatsapp
Facebook