Consider the following program:

1.10 Consider the following program:
main( )
{
char *k=”xyz;
f(k);
printf(“%s\n”,k);
}
f(char *k)
{ k = malloc(4); strcpy(k, “pq”); }
What will be the output?
A) pq
B) xyz
C) syntax error
D) none of the above

Leave a Reply