Hello,
I am getting the following error
25 C:\Dev-Cpp\main.cpp request for member `no' in `one', which is of non-class type `box[12]'
in the code
where 'one' is an object of struct type 'box' and 'no' is the variable inside the struct.
The above bit of code is just the simplified version of my complete code but basically I declared an array of struct type 'box' (size=12) , named it 'one', and am currently reading some numbers from a file into the variable 'no' of the struct.
I would be grateful if someone could let me know the source of the error. Thanks.
I am getting the following error
25 C:\Dev-Cpp\main.cpp request for member `no' in `one', which is of non-class type `box[12]'
in the code
Code:
while (!myfile.eof()) { for(int i=0;i<12;i++) { myfile>>one.no[i]; } }
The above bit of code is just the simplified version of my complete code but basically I declared an array of struct type 'box' (size=12) , named it 'one', and am currently reading some numbers from a file into the variable 'no' of the struct.
I would be grateful if someone could let me know the source of the error. Thanks.
Comment