Well, this is very weird.
The input file contains two integers on the first two lines then some other data.....
It is called 'input' and it is a txt doc.
It is in the same folder as my program.
Why does it fail to read in the integer correctly?
NOTE: I just started so I havent malloc'ed the struct array yet....
Thanks
Code:
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
struct info{
char name[30];
char month[30];
int day;
int year;
};
int main(void){
struct info* student;
int numClasses=0, numStudents;
FILE *ifp;
ifp= fopen("input.txt", "r");
//scan number of classes
fscanf(ifp, "%d", &numClasses);
printf("NUM CLASSES: %d\n", numClasses);
system("PAUSE");
return 0;
}