What is printed by each piece of code?
-
char fred[50];
strcpy(fred, "Today");
if (fred == "Today")
printf("Of course!\n");
else
printf("Today is not Today on planet C.\n");
-
char fred1[] = "barney", fred2[20] = "barney", *fred3 = "barney";
printf("%d %d %d %d %d %d\n",
strlen(fred1), strlen(fred2), strlen(fred3),
sizeof fred1, sizeof fred2, sizeof fred3);
-
char sue[] = "susan", *p;
for(p = sue; *p++; )
printf("%s", p);
printf("\n");
-
char bill[50] = "william";
strcpy(bill + 3, "ey coyote");
printf("%s\n", bill);
-
char *sharon = "sharon";
while(*++sharon) printf("%c", sharon[-1]);
printf("\n");