Question 4:
When the following main() is compiled with the above implementation
of revstring(), what is the output of the program?
main()
{
char s1[100];
strcpy(s1, "Give Him Six!");
printf("%s\n", revstring(s1));
}
|
Question 5:
When the following main() is compiled with the above implementation
of revstring(), what is the first line of output of the program?
main()
{
char s1[100];
char *s;
strcpy(s1, "Give Him Six!");
s = revstring(s1);
strcpy(s1, "Jim");
printf("%s\n", revstring(s1));
printf("%s\n", s);
}
|
Question 6:
What is the second line of output (of the program in Question 5)?
|
Question 7:
When the following main() is compiled with the above implementation
of revstring(), what is the output of the program?
main()
{
char *s, *s2, *s3;
strcpy(s, "Jim");
s2 = strdup(s);
s3 = revstring(s);
printf("%s\n", s2);
}
|