Hi guys,

I have a small doubt regarding pointers and functions.

Consider the following prototype

void insert(bst * head, int data);

This function creates a node and inserts the data in the node. Lets say i
call this function iteratively from main.

main(){

bst* record=NULL;
insert(record, 5);
insert(record, 8);

}

I see that record is not getting modified. Now is this related to call by
value. But since we are passing pointers shouldnt the change get reflected
in main.
isnt is similar to passing an array?
Enlighten me in this regard. I am tired of segfaults :(


Regards,
S.Nishaanth,
Computer Science and engineering,
IIT Madras.

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to