I keep recieving loadsa errors about data being non-aggregate and stuff, please tell me what is aggregate / non-aggregate data, how do I make my data aggregate and anythin else that I need to fo to sort this mess out!!!
I keep recieving loadsa errors about data being non-aggregate and stuff, please tell me what is aggregate / non-aggregate data, how do I make my data aggregate and anythin else that I need to fo to sort this mess out!!!
Does this mean that non-aggregate data is integers and stuff, and what does this mean ...
Error: request for member `xyz' in `fTemp', which is of non-aggregate type `PLANE ()()
could you please try and help me, would you need my source code to have more of an idea of what the problem is?
> Does this mean that non-aggregate data is integers and stuff,
Yes
> Error: request for member `xyz' in `fTemp', which is of non-aggregate type `PLANE ()()
It looks like you've tried to do something like fTemp.xyz or fTemp->xyz.
PLANE ()() suggests that fTemp is a pointer to some kind of function.
If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
If at first you don't succeed, try writing your phone number on the exam paper.
The fTemp is not a pointer (I don't think), it is just an object of class PLANE, anyway, can u look at this please and see if u have any idea of what is goin off ...
This is the code which I think is relevant...
class PLANE
{public:
XYZ xyz[3]; //XYZ = class containing v[3]
int texture;
int flags;
PLANE()
{};};
PLANE get_plane(int n)
{PLANE fTemp();
fTemp.xyz[0]=cXYZ(xyz[n]); *1
fTemp.xyz[1]=cXYZ(xyz[xyz[n].parent_index[0]]); *2
fTemp.xyz[2]=cXYZ(xyz[xyz[n].parent_index[1]]); *3
return fTemp; *4
};
Theses are the errors I get..
*1 Error: request for member `xyz' in `fTemp', which is of non-aggregate type `PLANE ()()'
*2 Error: request for member `xyz' in `fTemp', which is of non-aggregate type `PLANE ()()'
*3 Error: request for member `xyz' in `fTemp', which is of non-aggregate type `PLANE ()()'
*4 Error: conversion from `PLANE (*)()' to non-scalar type `PLANE' requested
I am just looking for a zip program so that I can fit all of my project in 1 file, because I think that the theyre is more to the problem than just the above code!!!!
Try this -
Code:class PLANE {public: XYZ xyz[3]; //XYZ = class containing v[3] int texture; int flags; PLANE() {}//If there are no other constructors explicit declaration not needed }; PLANE get_plane(int n) { PLANE fTemp; fTemp.xyz[0]=cXYZ(xyz[n]); fTemp.xyz[1]=cXYZ(xyz[xyz[n].parent_index[0]]); fTemp.xyz[2]=cXYZ(xyz[xyz[n].parent_index[1]]); return fTemp; }