Sunday, November 1, 2009

some coding doesn't understand.

What are these following sentences mean?
1. SNode(Dstring Data, SNode* next=(SNode*) 0);
2. this->top = (SNode*)0;
These sentences are shrinked. It should be several sentence for each.
Can somebody help me extend those sentences?
Thanks ahead.

2 comments:

  1. SNode(Dstring Data, SNode* next=(SNode*) 0)
    well there nothing to expand here. I think you problem is casting 0 to SNode*.
    Would this make your life easier?
    1. SNode(Dstring Data, SNode* next=NULL);
    2. this->top = NULL;
    Let me know!

    ReplyDelete
  2. Thank you Prof. Fardad.
    yes, change to "Null" is easy for me to understand. I'm very happy learned casting in this sentence. I know (int) variable is casting, but I didn't realize (SNode*) 0 is also casting.

    ReplyDelete