what is wrong?

thread closed.
Last edited on
Yeah... What's 0 (what you intialized average to be at line 19) divided by 4 (the only thing you do with average in that function)? What's that for loop for? Maybe I'm getting tierd and missing what you are trying to do...
closed account (zb0S216C)
What's that for loop for?

I think you're tired. He's defined 29 instances of Student in the form of an array. The for loop is supposed to loop 29 times. With each pass of the loop, the next student within the array is being initialized with the values entered by the user.

On line 35, and 37, you're asking the user to input a character, not a string. Consider using getline( ) for this. Here's a link to show you how to use getline( ): http://www.cplusplus.com/reference/string/getline/

Computergeek has pointed out the bug/error in your code. It's line 23. There's a illogical computation.
Last edited on
Deleting your post after you get a solution = lame

Forum posts are to help everyone. How can other people learn if you delete the question?
Topic archived. No new replies allowed.