Why does the output look the way it does?

Why is my output look the way it does when it should print something else?
Please help, i can't figure it out.

So this is what my file looks like and what my output should look like:

Last edited on
You're probably going out of bounds when it comes to reading in the file and displaying those values within the for loop(this tends to create garbage values if not properly implemented.). From your output, it seems that john is getting Mary's grades. Try subtracting 1 from MAX(the one in the for loop or i<MAX-1).
Last edited on
thank you, but subtracting MAX by 1 still gives me the same output with garbage values
Lines 42-44 should use child[0] and lines 46-48 should use child[1].
Thanks it worked!! its always little mistakes that get me
Glad it worked for you. But next time don't delete your original post, other people can learn from it.
Topic archived. No new replies allowed.