How to use sizeof()?

Where would i use sizeof() in my program? Would it be in the main body or in my function store_name? And would the code look like this: n = sizeof(child); or this int n = sizeof(child)/sizeof(info);

Last edited on
Why do you think you need to use sizeof?
I need to use it because in the rest of the program i find average of the three grades then find a letter grade for each student. When using only two students, the output prints for the two students but the rest of the output is filled with garbage values, which i don't want.
Last edited on
That has nothing to do with sizeof.

If you have an open array of objects, you should also have a variable tracking the number of objects in that array.
Topic archived. No new replies allowed.