Friday, February 15, 2013

Predict the output or error(s) for the following


Predict the output or error(s) for the following

#include
main()
{
struct xx
{
int x=3;
char name[]="hello";
};
struct xx *s;
printf("%d",s->x);
printf("%s",s->name);
}
Answer:



Compiler Error
Explanation:
You should not initialize variables in declaration

No comments:

Post a Comment