Discussion :: Strings
-
What will be the output of the program ?
#include
int main() { char str = "FRESHERGATE"; printf("%s\n", str); return 0; }
Answer : Option A
Explanation :
The line char str = "FresherGATE"; generates "Non portable pointer conversion" error.
To eliminate the error, we have to change the above line to
char *str = "FresherGATE"; (or) char str[] = "FresherGATE";
Then it prints "FresherGATE".
Be The First To Comment