-842150451
-6.27744e+066
-6.27744e+066
-6.27744e+066
-6.27744e+066
Press any key to continue . . .
As you can see the program is reading the first students information and outputting that fine, but the rest of the students have bad values for output. I'm guessing it's something to do with the pointer, but I really can't figure it out. Any help as to why it won't read all of the students info?
You are mixing formatted and unformatted input extraction without taking the proper precautions. You are also accessing outside the bounds of the array referenced by ptr.
If '\n' is encountered in the input stream by getline, getline will extract an empty string. With that in mind, can you figure out what is happening here?
Okay, I don't know why but I swear I tried this earlier and it didn't work and after I read what you said I tried it again and now it's working. All I did was insert an "fin.ignore();" statement right before the getline statement and I got the output I wanted.
By the way, what do you mean by, "You are mixing formatted and unformatted input extraction without taking the proper precautions. You are also accessing outside the bounds of the array referenced by ptr."
Thanks!