This is the mail archive of the
gcc@gcc.gnu.org
mailing list for the GCC project.
Re: string is const char [] ?
- To: Kamil Iskra <kamil at dwd dot interkom dot pl>
- Subject: Re: string is const char [] ?
- From: Alexandre Oliva <oliva at dcc dot unicamp dot br>
- Date: 24 Jun 1998 07:05:20 -0300
- Cc: egcs at cygnus dot com, egcs-bugs at cygnus dot com
- References: <Pine.LNX.3.95.980624115215.28323A-100000@plum.dwd.interkom.pl>
Kamil Iskra <kamil@dwd.interkom.pl> writes:
> On 23 Jun 1998, Alexandre Oliva wrote:
>> > char a1[] = "test not const";
>> This line should cause egcs to flag an error.
> Excuse me?! I missed the original mail, but do you really suggest that all
> the programmers should suddenly switch to:
> char a1[]={'t', 'e', 's', 't', ' ', 'n', 'o', 't', ' ', 'c', 'o', 'n',
> 's', 't', '\0'};
How about:
const char a1[] = "test not const";
--
Alexandre Oliva
mailto:oliva@dcc.unicamp.br mailto:aoliva@acm.org
http://www.dcc.unicamp.br/~oliva
Universidade Estadual de Campinas, SP, Brasil