Thursday 14 March 2013

Structure error example


#include<stdio.h>
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


Blog Author: Vijay Kumar

Go to: Java Aptitude

No comments:

Post a Comment