Archived

This topic is now archived and is closed to further replies.

Turnipo

Is this object valid?

Recommended Posts

Hi Folks, Here is a small snippet of code. Node *start = new Node(x1, y1, NULL, NULL); Node *end = new Node(x2, y2, NULL, NULL); Node *CurrentNode = start; Here I have created 2 nodes. I want to have a pointer to the node currently being processed. I have initialised the pointer to the start node. Have I done this correctly? Regards. -------------------------- Why are you driving like a hammerhead?

Share this post


Link to post
Share on other sites
You have the right idea. We can''t tell you if the specific code is correct because that depends on the ctor parameters like Elixir hinted at, but if it compiles (or you simply know the parameters are fine), then yeah, everything looks in order.

Share this post


Link to post
Share on other sites
@Zipster: Thats just personal preference. I like it more the way he did it. But mainly it''s symptomatic of VC6 or other code-autocompletion.
I like it more because whenever I revisit the code after a long time I keep asking myself where a variable was defined, if not written like that.

---------------------------
I may be getting older, but I refuse to grow up

Share this post


Link to post
Share on other sites