Discussion :: Strings
-
Will the program compile successfully?
#include
int main() { char a[] = "Fresher"; char *p = "GATE"; a = "GATE"; p = "Fresher"; printf("%s %s\n", a, p); return 0; }
Answer : Option B
Explanation :
Because we can assign a new string to a pointer but not to an array a.
Be The First To Comment