ProAnswers.org

How a pointer variable can accept the structure members?

typedef struct {

int a;

char b[30];

} MyStruct;

MyStruct p = (MyStruct) malloc(sizeof(MyStruct));

p->a = 1;

strcpy(p->b, “the shiznit”);