@jiten: that staement means pa is a pointer to 3 ints not an array of
pointers.. int *pa[3] means it is an array of pointers
On Fri, Aug 5, 2011 at 8:44 PM, Jiten j.playe...@gmail.com wrote:
(*pa)[3] ;// pa is array of pointers to int type;
so pa = arr; doesn't make any sense ,bcoz arr
I guess someone had posted a link earlier from which I have a basic doubt
when u have
int arr[3]={1,0,2};
int **dp;
int (*pa)[3];
is this the right assingment for instance?
pa=arr;
dp=arr;
or have I flipped the ampersand in assigning?
Also when I do pa++ will it jump by size of int or the
I dont think so dp=arr; since **dp; dp contains the addr of another ptr
variable...
On Fri, Aug 5, 2011 at 7:27 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote:
I guess someone had posted a link earlier from which I have a basic doubt
when u have
int arr[3]={1,0,2};
int **dp;
int
i see but is not arr a pointer to first array element and so arr contain
address of that pointer ?
On Fri, Aug 5, 2011 at 4:06 PM, Vijay Khandar vijaykhand...@gmail.comwrote:
I dont think so dp=arr; since **dp; dp contains the addr of another ptr
variable...
On Fri, Aug 5, 2011 at 7:27
but u initialized **dp means .
ex-dp=p and p=arr then its correct so dp contains addr of p which inturns
contains addrof arr now **dp is correct initialization.
On Fri, Aug 5, 2011 at 7:45 PM, Arun Vishwanathan aaron.nar...@gmail.comwrote:
i see but is not arr a pointer to first array
i think both are erroneous.
first statement i think you are trying to change the array address
which is not possible.
second statementarr doesn't make any sense i guess arr gives the
address but arr is not allowed
On Fri, Aug 5, 2011 at 4:19 PM, Vijay Khandar
i think 1st is wrong bt 2nd is correct..
On Fri, Aug 5, 2011 at 9:51 PM, nishaanth nishaant...@gmail.com wrote:
i think both are erroneous.
first statement i think you are trying to change the array address
which is not possible.
second statementarr doesn't make any sense i
first one is right and second is wrong.because dp will store address of
pointer and here you are storing address of int array.
--
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
both are wrong.run and see that warning will be displayed !!
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
On Fri, Aug 5, 2011 at 10:17 PM, pankaj kumar pancsen...@gmail.com wrote:
first one is right and second is wrong.because dp will store address
1st is right, n when you do pa++, it will jump by size of 1st one-D array(in
case array is of more than one dimension), even in this case, it'll jump by
the whole array size(6).
On 5 August 2011 23:20, Amol Sharma amolsharm...@gmail.com wrote:
both are wrong.run and see that warning will be
@nishant : where is the array address getting changed in first one? it just
says pa=arr
isnt arr address of the pointer to the first element of the array?
On Fri, Aug 5, 2011 at 6:21 PM, nishaanth nishaant...@gmail.com wrote:
i think both are erroneous.
first statement i think you are
@amol: hmm but I would like to know the reason for it if it is so
On Fri, Aug 5, 2011 at 7:50 PM, Amol Sharma amolsharm...@gmail.com wrote:
both are wrong.run and see that warning will be displayed !!
--
Amol Sharma
Third Year Student
Computer Science and Engineering
MNNIT Allahabad
int (*pa)[3];
pa is a pointer to an array of 3 elements for example in x[3] to
xin z[4][3] to z[0],z[1],z[2],z[3].so pa=arr is
correct and ..dp is a pointer that sore address of a pointer so
dp=a will give only warning but you can't do **dp in this case
(*pa)[3] ;// pa is array of pointers to int type;
so pa = arr; doesn't make any sense ,bcoz arr represents the base address
of it(address of arr[0]).
and pa represent the
address of pa[0](which hold a pointer).
I hope it's clear now
--
14 matches
Mail list logo