C
chets
Hi all
Can anyone tell me what is the difference between:-
*p=q; and p=&q; in C
where declaration is like this
char **p;
char *q;
Because if I do *p=q; in one file after mallocing q and want to free q
in another program, it does not do that, memory leakage.
if I do p=&q; than it works.
So if anyone can tell me how these are internally treated than it can
be helpful.
Thanks in advance.;
Can anyone tell me what is the difference between:-
*p=q; and p=&q; in C
where declaration is like this
char **p;
char *q;
Because if I do *p=q; in one file after mallocing q and want to free q
in another program, it does not do that, memory leakage.
if I do p=&q; than it works.
So if anyone can tell me how these are internally treated than it can
be helpful.
Thanks in advance.;