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> |
| int main() |
| { |
| char *p[1] = { "hello" }; |
| printf ( "%s" , (p)[0]); |
| return 0; |
| } |
Options:
a) Compile time error
b) Undefined behaviour
c) hello
d) None of the mentioned
Answer: C
No comments:
Post a Comment