digitalmars.D - problem with pointers
- bobef (7/7) Jan 15 2005 I am writing a XML parser in D, because all the links with such librirar...
- Ben Hinkle (6/19) Jan 15 2005 Assuming your nodes are class objects and not structs it will work if yo...
- Manfred Nowak (5/6) Jan 15 2005 [...]
- Miguel Ferreira Simões (280/280) Jan 15 2005 Try this! (I hope it works... I am no longer using this version)
I am writing a XML parser in D, because all the links with such libriraries are dead. And I have the following problem. When I parse the tags I set parent to each node (with pointer, basicly "something.parent=&somethingelse;"). When all is done address of objects seems changed and I get Access Violation if I use "node.parent". I tried to do the work with "cast(XMLnode*)somethingelse" instead of "&somethingelse" but it doesnt work neither. I could't find documentation about pointers in D and I'm stuck. Any ideas why is this?
Jan 15 2005
"bobef" <bobef_member pathlink.com> wrote in message news:csbh1t$2i0e$1 digitaldaemon.com...I am writing a XML parser in D, because all the links with such libriraries are dead. And I have the following problem. When I parse the tags I set parent to each node (with pointer, basicly "something.parent=&somethingelse;"). When all is done address of objects seems changed and I get Access Violation if I use "node.parent". I tried to do the work with "cast(XMLnode*)somethingelse" instead of "&somethingelse" but it doesnt work neither. I could't find documentation about pointers in D and I'm stuck. Any ideas why is this?Assuming your nodes are class objects and not structs it will work if you remove the &. Class objects in D have reference semantics (like Java, unlike C++) so using & takes the address of the reference not the object itself. -Ben
Jan 15 2005
bobef wrote: [...]I get Access Violation if I use "node.parent".[...] Seems that you want to use "node.parent*". -manfred
Jan 15 2005
Try this! (I hope it works... I am no longer using this version) I am going to re-design it soon. Miguel Ferreira Simoes begin 666 DXml-v1.20.rar M[K:AY\$W%865*[I?!;F<DN_;P.$]5L'IX^K2`IR;RC_L/NU\)C . 4Z"LJZ] M,?M(PIL4S-GQ*(1T() \`)P```!S`0```I-\?=Z$LXHQ'3,7`" ```!$6&UL M+78P+C(P7$18;6PN9&ED97!R: #PH M_(7/)K#HU4T)X+N[NYS;1L ?85PO,&$F^A"4*]\WG2J30*>WBZP<T*D,5S?1 MOT"ZR9E+_5F5_K9 NS$N9.P\2_&;9GTV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