[B]I've been trying to create a system using structures, when the user presses a corresponding number, a name, and subsequently details can be printed..[
But, after a few attempts..after compiling, it just 'crashes'...can anyone help me?/B]
Code:
#include <stdio.h>
#include <stdlib.h>
/*This is where I state my structure*/
struct cities {
char George;
char Tom;
char Luke;
char Mike;
};
/*Variables*/
int (input);
int main(void)
{
/* The input area for the user to decide*/
printf("\nWhich city would you like to know a little something about?");
printf("\n For George press 1\n Tom press 2\n Luke press 3\n Mike press 4\n");
scanf("%d",input);
if (input == 1)
printf("\nGeorge\n",George);
if (input == 2)
printf("\nTom\n",Tom);
if (input == 3)
printf("\nLuke\n",Luke);
if (input ==4)
printf("\n Mike\n",Mike);
system("PAUSE");
return 0;
}
Any help would be appreciated!!!
X