Hi I need help to understand pointer to pointer in C. What is a difference between char *argv[] and char **argv?
Thank you
Komal
On 16/09/04 00:37 +0530, komal wrote:
Hi I need help to understand pointer to pointer in C. What is a difference between char *argv[] and char **argv?
Syntactic sugar.
Though apparently C99 makes the differences between pointers and arrays more explicit.
Devdas Bhagat
On Wed, 2004-09-15 at 15:50, Devdas Bhagat wrote:
On 16/09/04 00:37 +0530, komal wrote:
Hi I need help to understand pointer to pointer in C. What is a difference between char *argv[] and char **argv?
Syntactic sugar.
Though apparently C99 makes the differences between pointers and arrays more explicit.
K & R zindabad!
On Wed, Sep 15, 2004 at 05:33:20PM -0400, Srinivasan Krishnan wrote:
Though apparently C99 makes the differences between pointers and arrays more explicit.
K & R zindabad!
Errr ... why's that?
Sameer.
linuxers-bounces@mm.ilug-bom.org.in wrote on 09/16/2004 10:41:01 AM:
On Wed, Sep 15, 2004 at 05:33:20PM -0400, Srinivasan Krishnan wrote:
Though apparently C99 makes the differences between pointers and arrays more explicit.
K & R zindabad!
Errr ... why's that?
Sameer.
pointers and arrays are different in the sense that an array cannot be asigned a new value. Look at the following piece of code for explanation:
int a[20]; int* b; int c=10; main() { b = &c; /*it's valid*/ a = &c; /*it's invalid, as a is constant and cannot be asigned a new value*/ }
I hope that helps.
Cheers, -Manu --------- Manu Garg http://manugarg.freezope.org
On Thu, 2004-09-16 at 01:11, Sameer D. Sahasrabuddhe wrote:
On Wed, Sep 15, 2004 at 05:33:20PM -0400, Srinivasan Krishnan wrote:
Though apparently C99 makes the differences between pointers and arrays more explicit.
K & R zindabad!
Errr ... why's that?
K & R syntax (first edition):
int somefunc() char *param1; int param2; {....}
Don't know how many people on the list have used the original K & R syntax, before C was ever looked at by a standards committee, but it is what I cut my teeth on, back in the days when SCO Xenix/286 ruled and M$'s C compiler was 16 bit (I started with Version 4, IIRC).
On 16 Sep 2004, agencies_ad1@sancharnet.in spake thusly:
Syntactic sugar.
can you explian me in plain english?
I would suggest you refer the following 2 excellent books for more information. The have a good treatment for pointers. #1 Let us C by Yeshwant Kanhetkar #2 Pointer in C by Yeshwant Kanhetkar
You should then ask, any difficulties you have, here.