Guys, ok after trying around stuff, I get that this is the way you initialize a structure in C.


typedef struct s
  int data;
  char gender; 
st s1={5,'a'};

int main(void)
 printf("%d "%c",,s1.gender);

 return 0;

But suppose i make a new instance of the structure, i again have to do a
st s2={5,'a'};

Couldnt this have been made much simpler if the structure could be defined as
typedef struct s

 int data = 5;
 char gender = 'a'

Couldnt this have been made much simpler if[...]

Yes, it could have. But like many features with the label "nice to have", the critical mass necessary to get it into the language specification wasn't ever reached. You might find a compiler that supports something along these lines as an extension though.