hi
i have an odd problem which i cannot see the answer to and was wondering if someone could help
i have a struct in a header file
for some weird reason it compiles then wont let me create the linked list
at the end of it all i get numerous errors the main one being
error c2232 left operand has struct type use '.'
and
error c2228 left of .next must have class/struct/union
then it says at th end fatal error c1903 unable to recover from previous error(s) stopping compilation
if anyone can help me with my simple problem id be very thankfull
thanks in advance
pcdave
[/CODE]
i have an odd problem which i cannot see the answer to and was wondering if someone could help
i have a struct in a header file
Code:
typedef struct simple{
int x;
int y;
float z;
simple *next;
}simple;
extern simple * firstSimple
for some weird reason it compiles then wont let me create the linked list
Code:
void add(list of params same as thos in struct other than pointer)
{
if (firstSimple == null)
{
simple current = new Simple()
simple->x=x;
same for other variables
firstSimple = current}
else{
polygon * eol;
eol = firstSimple;
while (eol.next != NULL)
{eol = eol.next;}
eol.next = new simple()
eol.next->x=x;
...
...
}
}
at the end of it all i get numerous errors the main one being
error c2232 left operand has struct type use '.'
and
error c2228 left of .next must have class/struct/union
then it says at th end fatal error c1903 unable to recover from previous error(s) stopping compilation
if anyone can help me with my simple problem id be very thankfull
thanks in advance
pcdave
[/CODE]