Re: pointer as argument and parameter
- From: CBFalconer <cbfalconer@xxxxxxxxx>
- Date: Thu, 29 Nov 2007 19:51:02 -0500
Eric Sosman wrote:
.... snip ...
If you tell the compiler that `b' is an array of `char*',
the same sort of thing goes on, except that the choice of
which rules to apply is a little different. Most of the
time, when you mention the name of an array you get a pointer
to the array's initial element -- hence the equivalence of
`b' and `&b[0]' in the function call. Since `b' is an
array of `char*', `b[0]' is one of those `char*' elements,
and `&b[0]' is therefore a `char**'.
I disagree. b[0] _is_ a char. It happens to be of the same type
as what is pointed at by a char* pointer. However *b is not a
pointer to a char. Thus "&b[0]" is not a char**.
--
Chuck F (cbfalconer at maineline dot net)
<http://cbfalconer.home.att.net>
Try the download section.
--
Posted via a free Usenet account from http://www.teranews.com
.
- Follow-Ups:
- Re: pointer as argument and parameter
- From: Eric Sosman
- Re: pointer as argument and parameter
- References:
- pointer as argument and parameter
- From: mdh
- Re: pointer as argument and parameter
- From: Eric Sosman
- pointer as argument and parameter
- Prev by Date: Re: malloc realloc and pointers
- Next by Date: Re: Global Variables : Where are they stored ?
- Previous by thread: Re: pointer as argument and parameter
- Next by thread: Re: pointer as argument and parameter
- Index(es):
Relevant Pages
|