Re: Is char*[] convertible to const char*[]?
- From: "Peter Nilsson" <airia@xxxxxxxxxxx>
- Date: 29 Aug 2005 15:49:34 -0700
kevin.hall@xxxxxxxxxxxxx wrote:
> > There is a faq on this.
>
> Do you mind pointing me to it? The only FAQ item I've ever seen is
> about converting non-arrays -- something like char* to const char*.
http://www.eskimo.com/~scs/C-faq/q11.10.html
What you're probably missing is that...
int main(int argc, char *argv[])
....is identical to...
int main(int argc, char **argv)
C cannot pass whole arrays, instead it passes pointers to the
first element. Hence, function parameters declared as arrays
are silently treated as pointers.
--
Peter
.
- Follow-Ups:
- Re: Is char*[] convertible to const char*[]?
- From: kevin . hall
- Re: Is char*[] convertible to const char*[]?
- References:
- Is char*[] convertible to const char*[]?
- From: kevin . hall
- Re: Is char*[] convertible to const char*[]?
- From: kernelxu
- Re: Is char*[] convertible to const char*[]?
- From: kevin . hall
- Re: Is char*[] convertible to const char*[]?
- From: Joe Wright
- Re: Is char*[] convertible to const char*[]?
- From: Peter Nilsson
- Re: Is char*[] convertible to const char*[]?
- From: kevin . hall
- Is char*[] convertible to const char*[]?
- Prev by Date: Re: UnSigned Long
- Next by Date: Re: UnSigned Long
- Previous by thread: Re: Is char*[] convertible to const char*[]?
- Next by thread: Re: Is char*[] convertible to const char*[]?
- Index(es):
Relevant Pages
|