Hi all,
I am trying to make a program but I have a problem. So I can't continue.
I am using a struct like that :
typedef struct account
{
char fullname[40];
int id;
int amount;
char name[15];
} account;
typedef struct parking_system
{
int pos;
char name[15];
char description[80];
float price;
int busy_lots;
account allaccounts[5];
int id;
} parking_system;
parking_system *myaccounts;
I have a variable that saves a string like char name[]="NAME";
But when I am trying to pass this value to my struct and then to print it
it does not work.
strcpy( myaccounts->allaccounts[myaccounts->pos].name,name);
myaccounts->pos ++;
printf("Name = \n",myaccounts->allaccounts[myaccounts->pos].name);
And another question how can I pass value to variable id for example using parking_system ?
What am I doing wrong ?
Please help!