ThreadBoard ArchivesSite FeaturesActiveworlds SupportHistoric Archives |
Pointers, structures, and linked lists (Sdk)
Pointers, structures, and linked lists // Sdktwisted horizonJan 2, 2001, 9:09pm
This is a multi-part message in MIME format.
------=_NextPart_000_0035_01C074E7.09F20FE0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable First off, I'd like to say that this may be off topic. It isn't an SDK = question, but is for a program being used in conjunction with the AW = SDK, for a bot program, and this is the only place I know to look for = programmers. Secondly, I'm programming in C/C++. All you VB botters.... just shoo.... = lol, next..... With my new skill and horrible talent for programming linked lists, I = decided to implement an avatar database in my next bot. Of course, with = my lack of books or buddies (on-line, that is) I wasn't able to get much = response to a question I've been asking around... I have a line of code like this right before freeing an element from my = linked list: current.previous.next =3D current.next Would this line be legal, or can I not have two dots in the first use? Any responses (aside from about how horribly my linked lists work) would = be greatly appreciated. Thanks in advance, Twisted Horizon ------=_NextPart_000_0035_01C074E7.09F20FE0 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>First off, I'd like to say that this = may be off=20 topic. It isn't an SDK question, but is for a program being used in = conjunction=20 with the AW SDK, for a bot program, and this is the only place I know to = look=20 for programmers.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>Secondly, I'm programming in C/C++. = All you VB=20 botters.... just shoo.... lol, next.....</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT size=3D2>With my new skill and horrible talent for = programming linked=20 lists, I decided to implement an avatar database in my next bot. Of = course, with=20 my lack of books or buddies (on-line, that is) I wasn't able to get much = response to a question I've been asking around...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>I have a line of code like this right before freeing = an=20 element from my linked list:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current.previous.next =3D current.next</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Would this line be legal, or can I not have two dots = in the=20 first use?</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Any responses (aside from about how horribly my = linked lists=20 work) would be greatly appreciated.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Thanks in advance,</FONT></DIV> <DIV><FONT size=3D2>Twisted Horizon</FONT></DIV></BODY></HTML> ------=_NextPart_000_0035_01C074E7.09F20FE0-- john viperJan 2, 2001, 10:31pm
This is a multi-part message in MIME format.
------=_NextPart_000_0018_01C074F2.48E85FF0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable If I understand your question correctly, you can have as many dots as = necessary. I hate pointers, however. Thats why I am moving to Java heh = :-) -John [View Quote] ------=_NextPart_000_0018_01C074F2.48E85FF0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META content=3Dtext/html;charset=3Diso-8859-1 = http-equiv=3DContent-Type> <META content=3D"MSHTML 5.00.2920.0" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT face=3DArial size=3D2>If I understand your question = correctly, you can=20 have as many dots as necessary. I hate pointers, however. = Thats why=20 I am moving to Java heh :-)</FONT></DIV> <DIV> </DIV> <DIV><FONT face=3DArial size=3D2>-John</FONT></DIV> <BLOCKQUOTE=20 style=3D"BORDER-LEFT: #000000 2px solid; MARGIN-LEFT: 5px; MARGIN-RIGHT: = 0px; PADDING-LEFT: 5px; PADDING-RIGHT: 0px"> <DIV>"twisted horizon" <<A=20 = href=3D"mailto:joshua_trask at capecod.com">joshua_trask at capecod.com</A>>= wrote=20 in message <A=20 = href=3D"news:3a525fc3 at server1.Activeworlds.com">news:3a525fc3 at server1.Act= iveworlds.com</A>...</DIV> <DIV><FONT color=3D#000000 size=3D2>First off, I'd like to say that = this may be=20 off topic. It isn't an SDK question, but is for a program being used = in=20 conjunction with the AW SDK, for a bot program, and this is the only = place I=20 know to look for programmers.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>Secondly, I'm programming in = C/C++. All you VB=20 botters.... just shoo.... lol, next.....</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT size=3D2>With my new skill and horrible talent for = programming linked=20 lists, I decided to implement an avatar database in my next bot. Of = course,=20 with my lack of books or buddies (on-line, that is) I wasn't able to = get much=20 response to a question I've been asking around...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>I have a line of code like this right before = freeing an=20 element from my linked list:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current.previous.next =3D = current.next</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Would this line be legal, or can I not have two = dots in the=20 first use?</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Any responses (aside from about how horribly my = linked lists=20 work) would be greatly appreciated.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Thanks in advance,</FONT></DIV> <DIV><FONT size=3D2>Twisted = Horizon</FONT></DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_0018_01C074F2.48E85FF0-- faberJan 15, 2001, 4:27pm
This is a multi-part message in MIME format.
------=_NextPart_000_0048_01C07F28.B9A17700 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable TH, current.previous.next =3D current.next is grammatically legal, however = will not work if any "current" or "previous" is a pointer, and i = suppose both are (they could be references though). In which case you would have to use current->previous->next =3D current->next; for double-linked lists you usually also encounter current->next->previous =3D current->previous; and your=20 delete current; // which would not work if current was not a pointer Regards, Faber "twisted horizon" <joshua_trask at capecod.com> schrieb im Newsbeitrag = news:3a525fc3 at server1.Activeworlds.com... First off, I'd like to say that this may be off topic. It isn't an SDK = question, but is for a program being used in conjunction with the AW = SDK, for a bot program, and this is the only place I know to look for = programmers. Secondly, I'm programming in C/C++. All you VB botters.... just = shoo.... lol, next..... With my new skill and horrible talent for programming linked lists, I = decided to implement an avatar database in my next bot. Of course, with = my lack of books or buddies (on-line, that is) I wasn't able to get much = response to a question I've been asking around... I have a line of code like this right before freeing an element from = my linked list: current.previous.next =3D current.next Would this line be legal, or can I not have two dots in the first use? Any responses (aside from about how horribly my linked lists work) = would be greatly appreciated. Thanks in advance, Twisted Horizon ------=_NextPart_000_0048_01C07F28.B9A17700 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN"> <HTML><HEAD> <META http-equiv=3DContent-Type = content=3Dtext/html;charset=3Diso-8859-1> <META content=3D"MSHTML 5.50.4522.1800" name=3DGENERATOR> <STYLE></STYLE> </HEAD> <BODY bgColor=3D#ffffff> <DIV><FONT size=3D2>TH,</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current.previous.next =3D current.next is = grammatically=20 legal, however will not work if any "current" or "previous" is a = pointer,=20 and i suppose both are (they could be references though).</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>In which case you would have to use</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current->previous->next =3D = current->next;</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>for double-linked lists you usually also=20 encounter</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current->next->previous =3D=20 current->previous;</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>and your </FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>delete current; // which would not work if current = was not a=20 pointer</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Regards,</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Faber</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2></FONT><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV>"twisted horizon" <<A=20 href=3D"mailto:joshua_trask at capecod.com">joshua_trask at capecod.com</A>>= schrieb=20 im Newsbeitrag <A=20 href=3D"news:3a525fc3 at server1.Activeworlds.com">news:3a525fc3 at server1.Act= iveworlds.com</A>...</DIV> <BLOCKQUOTE dir=3Dltr=20 style=3D"PADDING-RIGHT: 0px; PADDING-LEFT: 5px; MARGIN-LEFT: 5px; = BORDER-LEFT: #000000 2px solid; MARGIN-RIGHT: 0px"> <DIV><FONT color=3D#000000 size=3D2>First off, I'd like to say that = this may be=20 off topic. It isn't an SDK question, but is for a program being used = in=20 conjunction with the AW SDK, for a bot program, and this is the only = place I=20 know to look for programmers.</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT color=3D#000000 size=3D2>Secondly, I'm programming in = C/C++. All you VB=20 botters.... just shoo.... lol, next.....</FONT></DIV> <DIV><FONT color=3D#000000 size=3D2></FONT> </DIV> <DIV><FONT size=3D2>With my new skill and horrible talent for = programming linked=20 lists, I decided to implement an avatar database in my next bot. Of = course,=20 with my lack of books or buddies (on-line, that is) I wasn't able to = get much=20 response to a question I've been asking around...</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>I have a line of code like this right before = freeing an=20 element from my linked list:</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>current.previous.next =3D = current.next</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Would this line be legal, or can I not have two = dots in the=20 first use?</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Any responses (aside from about how horribly my = linked lists=20 work) would be greatly appreciated.</FONT></DIV> <DIV><FONT size=3D2></FONT> </DIV> <DIV><FONT size=3D2>Thanks in advance,</FONT></DIV> <DIV><FONT size=3D2>Twisted = Horizon</FONT></DIV></BLOCKQUOTE></BODY></HTML> ------=_NextPart_000_0048_01C07F28.B9A17700-- |