+2 votes
by kratos

What will be the output of the following code segment, if any?

myfunc ( struct test t) {

strcpy(t.*, “world”);

}

main( ) {

struct test { char *[10]; } t;

strcpy(t.*, “Hello”);

printf(“%”, t.);

myfunc(t);

printf(“%”, t.); }

(A) Hello Hello

(B) world world

(C) Hello world

(D) the program will not compile

1 Answer

+4 votes
by kratos
 
Best answer

Correct option -**(D) the program will not compile**

Explanation:-

The program will not compile because undefined symbol * for myfunc( ) function. Structure should be defined before the main and the function where it is called.

...