This is the mail archive of the gcc@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]

Re: string is const char [] ?


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



Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]