Ok I am learning how to pass structures to a function and I keep getting an error about return type of main is not int, and it does not display the name.
I am following along in the book that I have, and this program is almost just like one they have in there. I don't really understand what I am doing wrong. Here is my code
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct player {
char name[20];
int skill;
};
void pstruct(struct player profile);
void main()
{
struct player info;
strcpy(info.name,"Vertex");
pstruct(info);
system("pause");
}
void pstruct(struct player profile)
{
printf("%s\n",profile.name);
}