• We’re currently investigating an issue related to the forum theme and styling that is impacting page layout and visual formatting. The problem has been identified, and we are actively working on a resolution. There is no impact to user data or functionality, this is strictly a front-end display issue. We’ll post an update once the fix has been deployed. Thanks for your patience while we get this sorted.

Reading a text file with different variables

SoundTheSurrender

Diamond Member
Hello, I am trying to read from a text file and this is what I have so far.

The text file looks like this but longer.

0 111111112 15 155
1 1111 4 A
1 1112 4 B
1 1113 3 C
0 111111111 30 90
1 1111 4 A
1 1112 3 A

0 stands for student followed by its ssn and 2 other variables that I must do math with.

1 stands for class followed by the class number, credit hours, and the grade in the course. The grade must be converted into a number A = 4, B = 3, C = 2, D = 1, F = 0.

I keep getting a infinate loop even though I used the &&1 in my while loop. Any ideas?
 
Ahhh, wow, the attach code function is useless. I can't see anything useful, except that you're using C++, so I have to ask...why? This job is much better suited to a scripting language (e.g. Perl). If you have to use C++, then try linking us to a text file so it's legible.
 
Back
Top