Could someone dig a newbie out of a hole, I am trying to get to grips with structs I have struggled a little bit. I wrote the code below to try and get a working program and give me something to build on. The code below will compile fine but will crash after the user has entered his name. The problem I think is with the typedef the program won't allow me to delare the pointer to the struct globally, but it works fine if declare it locally.
No doubt the solution is obvious but thank you for your help in advance.
Terry
#include<stdio.h>
typedef struct person{
char name[21];
float cost;
int number;
}PLAYER;
PLAYER *me; program will not work if this decleration is used
int main()
{
int a;
/*PLAYER *me;*/ program works if this decleration is used
printf("insert your name\n\n");
scanf("%s",me->name);
printf("your name is %s\n\n", me->name);
scanf("%d",&a);/*KEEPS THE WINDOW OPEN*/
return (0);
}