Article View: comp.std.c
Article #220Re: const T **
From: John F. Woods
Date: Wed, 15 Apr 1992 15:28
Date: Wed, 15 Apr 1992 15:28
22 lines
1027 bytes
1027 bytes
smclewin@ultrix.ramapo.edu (Scooter McLune) writes:
>donne@imec.be (Werner Donne) writes:
>>int
>>main(void)
>>{
>> const char **a;
>> char **b;
>> a = b;
>> return 0;
>>}
>The assignment cannot be done because **a is a constant variable, by your
>definition. If you were to do the assignment "b = a" with the code you
>have above, there would be no problem.
No. "b = a;" is illegal for the same reason "a = b;" is; the two objects
are not pointers to compatible types (const char * is not compatible with
char *).
Your first sentence is confusing; are you arguing that a is constant (false,
that would be "char ** const a"), or that "a = b;" somehow would modify the
const object at **a (false)?
Technical Details
Message-ID:
<11455@ksr.com>Path:
arc1-ca.pugleaf.net!sparky!uunet!world!ksr!jfwReferences:
<1611@imec.UUCP> <smclewin.703286671@ultrix.ramapo.edu>Show Full Headers
Complete Article Headers
Path: arc1-ca.pugleaf.net!sparky!uunet!world!ksr!jfw From: jfw@ksr.com (John F. Woods) Newsgroups: comp.std.c Subject: Re: const T ** Keywords: const Message-ID: <11455@ksr.com> Date: 15 Apr 92 11:28:32 EDT References: <1611@imec.UUCP> <smclewin.703286671@ultrix.ramapo.edu> Sender: news@ksr.com Lines: 22