C - Pointers - Discussion

You Are Here :: Home > C > Pointers - Discussion

 



Q.

Consider the following program fragment, assuming the #include directive:

char saying[] = "Too many cooks spoil the broth.";
char *p1, *p2;
p1 = saying;
p2 = saying + 8;
*p2 = '\0';
printf("%s\n", saying);
What string will be printed?

A. "Too many cooks spoil the broth." B. "cooks spoil the broth."
C. "Too many" D. "Too manycooks spoil the broth."

Answer: Option C
Explaination:

No Explanation



Discussion

Your Comments Goes here...
NameDiscussion