>> Would appreciate any help.
I think it would be best to start a separate thread and post your code and the exact error message. These types of errors can have many different causes.
>> Would appreciate any help.
I think it would be best to start a separate thread and post your code and the exact error message. These types of errors can have many different causes.
Persoanlly, I woudl just treat the class as if it were a struct. The member functions are only contextual, they dont actually occupy space in the object. You may want to use #pragma pack(1) to guarantee the smallest footprint
I declare it in my class and when I wnat to use the function as below I get the error message No match for operator[]. If I remove the line dayReport[i].dayOfMonth = dayP then it works but it is not read into the array.
Code:istream& operator >> (istream& fin, weatherReport dayReport[]) { Do something dayReport[i].dayOfMonth = dayP; }
I think you should be reading into a weatherReport & instead of into the array. That's just how it's done in C++. Move the code that loops through the array into a separate function and read into each weatherReport one at a time.