struct contact
{
char name[20],email[20];
int hpnum;
}add;
int option;
int main (void)
{
system("cls");
printf("==========Welcome to Jeffery's Contact System Management==========\n");
printf("\t\t\tContact System Main Menu\n");
printf("[1] Create a New Contact\n");
printf("[2] Modified Existing Contact\n");
printf("[3] Delete Existing Contact\n");
printf("[4] Search Existing Contact\n");
printf("[5] Exit\n");
printf("Please enter one of your option.\n");
scanf("%d",option);
switch(option)
{
//add new contact
case 1:
printf("Contact Name: ");
scanf("%s",&add.name);
printf("\nHandphone Number: ");
scanf("%d",&add.hpnum);
printf("\nE-mail: ");
scanf("%s",add.email);
break;
}
getch();
}
What's the problem of this coding? I can run it, but once choose no. 1, there haven an error. If my coding is wrong, please inform me. I still a beginner, hope you all can help me in this.