i get the right number .. but.. i then need to use num_students. in a for loop.. but wont let me.. cause its a char..
inFile.getline(num_students,MAXCHARS, ' ');
cout << "Number of Students" << num_students <<endl;
i change it to int.. but it doesnt work..
how to i just pull one integer from a file..
This will read the first integer from the file data.txt.
inFile >> num_students;
or you could use a get function
fin >> num_students;
oh, you just found out huh? :)