I do not understand how size of details make you output name and age? What if size of reads both name and age together and outputs both in x.name? I am confused how it is making x.name and x.age output?
I do not understand how size of details make you output name and age?
It doesn't output it, sizeof() returns the size of an object in bytes, in my machine, sizeof(details) returns 124, it is then passed as the second argument of istream::read() which make it extract 124 byes from the file
What if this 124 bytes include both name and age ? How does it differentiate between name and age? Sorry if I sound stupid...This is first time we are learning this in class