Thread: non-aggregate data, whats all that about?

  1. #1
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Angry non-aggregate data, whats all that about?

    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!!!

  2. #2
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Lightbulb still havin trouble!!!

    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?

  3. #3
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,661
    > 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.

  4. #4
    Registered User
    Join Date
    Sep 2001
    Posts
    3

    Still Sutck!!!

    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!!!!

  5. #5
    of Zen Hall zen's Avatar
    Join Date
    Aug 2001
    Posts
    1,007
    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;  
    }

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. xor linked list
    By adramalech in forum C Programming
    Replies: 23
    Last Post: 10-14-2008, 10:13 AM
  2. Bitmasking Problem
    By mike_g in forum C++ Programming
    Replies: 13
    Last Post: 11-08-2007, 12:24 AM
  3. brace-enclosed error
    By jdc18 in forum C++ Programming
    Replies: 53
    Last Post: 05-03-2007, 05:49 PM
  4. Program Crashing
    By Pressure in forum C Programming
    Replies: 3
    Last Post: 04-18-2005, 10:28 PM
  5. Replies: 1
    Last Post: 07-31-2002, 11:35 AM