Q: What is the output of this C code?
Options:
a) Compile time error
b) Undefined behaviour
c) hello
d) None of the mentioned
Answer: C
|  | #include <stdio.h> | 
|  | intmain() | 
|  | { | 
|  |     char*p[1] = {"hello"}; | 
|  |     printf("%s", (p)[0]); | 
|  |     return0; | 
|  | } | 
Options:
a) Compile time error
b) Undefined behaviour
c) hello
d) None of the mentioned
Answer: C
 
No comments:
Post a Comment