Wednesday, 10 December 2014

Programming Quiz-3

Q: What is the output of the below c code?

#include <stdio.h>

void main()

{

    char *s = "hello";

    char *p = s;

    printf("%p\t%p", p, s);

}

Options:

a) Different address is printed
b) Same address is printed
c) Run time error
d) Nothing

Answer: B

No comments:

Post a Comment