I am getting the following error when I compile my program on gcc. two or more data types in declaration of `main'
Also I want to print out the structure in one of my cases but won't let me call the structure and I don't understand. Please help.. I am new to this programming.
Here is the code.
Code:
#include <stdio.h>
#include <stdlib.h>
int num_comp;
float num_months;
struct company{
char city[30];
float months[10];
char name[20];
char manager[20];
}
int main(int argc, char **argv){
FILE *fp;
struct company;
char filename[20];
int month,choice;
printf("Please enter the name of the relevant file: ");
scanf("%c", filename);
fp = fopen(filename, "r");
printf("Please enter your choice:" );
printf("1. Enter 1 to get the statistics for a specific month.");
printf("2. Enter 2 to get the overall statistics.");
printf("3. Enter 0 to terminate the program.");
switch(choice){
case 0:
printf("Good Bye!");
break;
case 1:
printf("Which month are you interested in? ");
scanf("%d", month);
break;
case 2:
printf("The statistcs are below: %s\n");
break;
default:
break;
}
return 0;
}