You didn't create a new type in int *. You didn't create a new type in int []. Since you didn't create it, it's not a struct type. Only you can create structs.
You didn't create a new type in int *. You didn't create a new type in int []. Since you didn't create it, it's not a struct type. Only you can create structs.
thanks i think i understood this struct thing
what this line means
i know that ! means differ but here they didnt mentionCode:if(!tree)return NULL;
differ what??
Simple boolean magic.
Basic rules:
0 is false. Always.
Everything else is true. Always.
Basic if form:
if (!tree == true)
Let us assume that tree contains a value of NULL.
Thusly, tree is interpreted as false in boolean form (since NULL is one way or another 0).
Thus, we get:
if (!false == true)
The ! operator will invert the meaning of the value it is applied to, so we get:
if (true == true)
Or in other words, it's a short-hand for:
if (tree == NULL)
ok i understood this "!" thing
igot problem understanding something else
its a complex variable
inside this node variable we have two sub variables
data (which can be null or not)
so is the sub variable next
those two different sub variable
we cant see them as one
i dont know what the meaning of tree=null
regarding its subvariables
??
Last edited by transgalactic2; 10-27-2008 at 03:27 PM.
See them as one what? They already are one node.
what are the values of root.data and root.next
when we do
Code:root=null;
Code:if(!root) { /* Not messing with members of root goes here!!!!! */ }
when we are doing
root=null
we treat it as if it was a simple variable
but its not
what are the values of root.data and root.nextCode:root=null;
when we do
but its of a complex type
so i guess
it puts null on every sub variable of this type