Re: I need some basic C++ help
From: John Carson (donaldquixote_at_datafast.net.au)
Date: 11/20/03
- Next message: John Carson: "Re: I need some basic C++ help"
- Previous message: Victor Bazarov: "Re: Default Parameters in Nested Templates ?"
- In reply to: Andrey Tarasevich: "Re: I need some basic C++ help"
- Next in thread: Dave: "Re: I need some basic C++ help"
- Reply: Dave: "Re: I need some basic C++ help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: Thu, 20 Nov 2003 14:20:44 +1100
"Andrey Tarasevich" <andreytarasevich@hotmail.com> wrote in message
news:vrobpatfvpl799@news.supernews.com
> John Carson wrote:
> > "Dave" <better_cs_now@yahoo.com> wrote in message
> > news:vro33uncnb3kc8@news.supernews.com
> > >
> > > Oops, sorry, I should have said "array of const char" instead of
> > > "const char
> > > *". So, it's really an array, and *then* that array undergoes a
> > > conversion to a pointer when the compiler encounters "modem".
> > > Finally then, as I said before, a pointer cannot be assigned to an
> > > array...
> >
> > It is not the chars that are const --- if they were you couldn't
> > change the char values. Rather, it is the location in memory of the
> > chars that cannot be changed. In pointer terms, it is like a const
> > pointer to char, i.e., char * const
>
> I think Dave was talking about the literal. String literal is an
> "array
> of const char" and its 'char' values cannot be changed.
>
You are right. I didn't read the post carefully enough.
-- John Carson 1. To reply to email address, remove donald 2. Don't reply to email address (post here instead)
- Next message: John Carson: "Re: I need some basic C++ help"
- Previous message: Victor Bazarov: "Re: Default Parameters in Nested Templates ?"
- In reply to: Andrey Tarasevich: "Re: I need some basic C++ help"
- Next in thread: Dave: "Re: I need some basic C++ help"
- Reply: Dave: "Re: I need some basic C++ help"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|