Q. | What will be the output of the following code segment, if any? myfunc ( struct test t) {
strcpy(t.s, "world");
}
main( ) {
struct test { char s[10]; } t;
strcpy(t.s, "Hello");
printf("%s", t.s);
myfunc(t);
printf("%s", t.s);
}
|
|||||||
|
Answer: | Option D | |
Explaination: | The program will not compile because undefined symbol s for myfunc( ) function. Structure should be defined before the main and the function where it is called. |
Discussion
Your Comments Goes here... |
Name | Discussion |
---|