Code:
int main()
{
int index, points[6];
char input[250], output[250];
FILE *ifp, *ofp;
printf("Which file would you like to read from?\n");
scanf("%s", input);
printf("Which file would you like to write too?\n");
scanf("%s", output);
//Opens the output file to be written too
ifp = fopen(output, "w");
//Opens the input file too be read from
ofp = fopen(input, "r");
return 0;
}
This is what I currently have. What my program needs to do is open a file that the user chooses and then go through it and make a calculation. A sample input file looks like this:
4
Chris_Webber F 978 447 252 68 34
Allen_Iverson G 2302 299 597 180 9
Grant_Hill F 1317 318 220 97 28
Steve_Francis G 1663 450 547 112 28
The number of players at the top and then there name, position, and then stats(which I will need to do a calculation with later. How would I go about programming this. I am not asking anyone to hand feed me code, I just want an idea of where to start. Thanks in advance