Peculiar Problem with typedef
Hi , I have a problem with this code in this "typedef"
typedef struct {
char codename[120];
int money;
int point;
}item2;
if I remove the "int point;" the code works ok. When I use "int point;" run the program and choose option 2,it shows me a windows error message "has encountered a problem and needs to close". Any suggestions? I have also included 2 files that are read with option 1 and 2. options 3-4 are under construction
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
void menu(void);
void insert_points();
void menu_choice();
void insert_clients();
typedef struct {
int low_limit;
int hi_limit;
int points;
}item1;
typedef struct {
char codename[120];
int money;
int point;
}item2;
item1 *array1;
item2 *array2;
int main(int argc, char *argv[])
{
printf("\n<<<<Welcome to Super Market Program>>>\n");
arxi:
menu();
menu_choice();
goto arxi;
system("PAUSE");
return 0;
}
void menu(void)
{
printf("\nPlease choose one of the following:\n\n");
printf("1. Insert Points File\n");
printf("2. Insert Shopping File\n");
printf("3. Best Clients\n");
printf("4. Client's Data\n\n");
printf(">");
}
void menu_choice(){
int choice;
scanf("%d",&choice);
switch(choice)
{
case 1:
insert_points();
break;
case 2:
insert_clients();
break;
case 3:
break;
case 4:
break;
default:
printf("\nERROR: The number must be between 1-4\n\n");
break;
}
}
void insert_clients()
{}