ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
This is how you can tell (Sdk)
This is how you can tell // Sdktwisted horizonJan 3, 2001, 12:03am
This is a multi-part message in MIME format.
------=_NextPart_000_0011_01C074FF.2A9EB320 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable This is how you can tell I'm working on a big project - the continuous = posting of general programming questions. I've spread this one around a = little, but still no replies... see if you can give it a shot. while(jcurrent.next !=3D NULL), browsing my jackpot-holding signs to = hold the jackpot amount on, and i get error C2228: left of '.next' must = have class/struct/union type, but i already struct jackpot_sign = *jcurrent;, any ideas? -Twisted Horizon ------=_NextPart_000_0011_01C074FF.2A9EB320 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD W3 HTML//EN"> <HTML> <HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type> <META content=3D'"MSHTML 4.72.3110.7"' name=3DGENERATOR> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT color=3D#000000 size=3D2>This is how you can tell I'm working = on a big=20 project - the continuous posting of general programming questions. I've = spread=20 this one around a little, but still no replies... see if you can give it = a=20 shot.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>while(jcurrent.next !=3D NULL), = browsing my=20 jackpot-holding signs to hold the jackpot amount on, and i get error = C2228: left=20 of '.next' must have class/struct/union type, but i already struct = jackpot_sign=20 *jcurrent;, any ideas?</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>-Twisted = Horizon</FONT></DIV></BODY></HTML> ------=_NextPart_000_0011_01C074FF.2A9EB320-- grimbleJan 3, 2001, 12:13am
Long time since I played with C/C++, but from what I remember you need to
crow-foot from a pointer or use the instance of the pointer object ... i.e. since jcurrent is a pointer to a struct ... jcurrent->next OR *jcurrent.next (might be the need for some brackets in there somewhere on the 2nd one) Is this right? Not sure ... try it. Anyone wanna shoot me to dust? Grims [View Quote] while(jcurrent.next != NULL), browsing my jackpot-holding signs to hold the jackpot amount on, and i get error C2228: left of '.next' must have class/struct/union type, but i already struct jackpot_sign *jcurrent;, any ideas? twisted horizonJan 3, 2001, 8:23pm
Ah yes, I read about that when I was learning pointers and all, but I never
did manage to see its importance. That fixes it, thx. -Twist [View Quote] faberJan 15, 2001, 4:33pm
TH,
example: If "current" was a pointer to a struct "foobar" having a member "next" being itself a pointer to "foobar" too, you can access like this: struct foobar { struct foobar *next; } current; current (the pointer, i.e. type is (struct foobar *) ) *current (the structure it points to, type is (struct foobar) (*current).next (the member "next" of the struct described as (*current), type is (struct foobar *) current->next (the member next of the struct pointed to by "current", i.e. same thing as above) *(current->next) (the struct being pointed to by the member next of the struct pointed to by "current), type (struct foobar); etc etc... i hope these examples shed some light on the matter :) Faber "twisted horizon" <joshua_trask at capecod.com> schrieb im Newsbeitrag news:3a53a65d$1 at server1.Activeworlds.com... > Ah yes, I read about that when I was learning pointers and all, but I never > did manage to see its importance. That fixes it, thx. > > -Twist [View Quote] |