I have been slaving over this for hours. Why is the following code:
Code:
#include <stdio.h>
struct players
{
char name[100];
char position[100];
double points;
double steals;
double blocks;
double rebounds;
};
struct players nba[100];
int main()
{
FILE *ifp, *ofp;
char inputFile[100];
char outputFile[100];
int numberPlayers;
printf("What is the name of the input file?\n");
scanf("%s", inputFile);
printf("What is the name of the output file?\n");
scanf("%s", outputFile);
ifp = fopen("players.txt", "r");
fscanf(ifp, "%d", &numberPlayers);
fclose(ifp);
fclose(ofp);
return 0;
}
Returning this error:
Code:
0 [main] a 3060 handle_exceptions: Exception: STATUS_ACCESS_VIOLATION
10000 [main] a 3060 stackdump: Dumping stack trace to a.exe.stackdump
----jGRASP cygwin wedge2: process died on signal 11.
----jGRASP: operation complete.
I know it must be something simple that I'm doing, but I just cannot seem to figure it out. If you guys could help me I'd love you forever.