pls tell what is the difference between this two
1)taking a initger (or any fundamental data type) pointer in the main function and then send it to some funtion as parameter.
int *p;
function(p);
2)taking a intiger and sending its adress to any function.
int p;
function(&p);
will both do the same?
if not the what is the advantage of both of this.
i have another question.
in some link list program i saw that they have taken a structure pointer in the main function and have sent the adress of that pointer to the funtion.
main()
{
struct node *p;
function(&p);
}
function(struct node **p);
i am not under standing why they have taken pointer of pointer.why i cant send p as a parameter.
then thecode will be like this
main()
{
struct node *p;
function(p);
}
function(struct node *p);
what is the problem in this?
pls reply as early as u can.coz i am stucked here.