[amit@localhost cprg]$ gcc -Wall -Werror struct.c
struct.c: In function `main':
struct.c:18: error: dereferencing pointer to incomplete type
[amit@localhost cprg]$ cat struct.c
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
/Declaration of structure/
struct human
{
char *first;
char gender[10];
int age;
} man, *p_human;
struct man *p_man;
int main(void)
{
strcpy(man.gender,"Male");
printf("%s\n",man.gender);
printf("%s\n",p_man->gender); <----------
exit(EXIT_SUCCESS);
}
The "p_man" is pointer to structure "man".what am i missing here.
Thanks,
~amit