I have a text file that looks like this:
4
3
Samantha Octavia Ivan Henry
100 90 65 70
99 50 70 88
88 90 98 100
I am wanting to just read the first 2 lines individually and print them out, but as it stands now it is giving me a huge number.
inputFile = fopen ("input.txt", "r");
//input
if( inputFile == NULL)
{
printf ("Unable to open file input.txt");
exit(EXIT_FAILURE);
}
else
{
printf ("How many students?\n ");
fscanf (inputFile, "%d", &students);
printf ("%d", &students);
printf ("\nHow many assignments?\n ");
fscanf (inputFile, "%d", &assignments);
printf ("%d", &assignments);
printf ("\n");
}
What am I missing here?