-----Original Message-----
From: c400-l-bounces@xxxxxxxxxxxx [mailto:c400-l-bounces@xxxxxxxxxxxx]On
Behalf Of Jevgeni Astanovski
Sent: Wednesday, August 18, 2004 12:21 PM
To: C programming iSeries / AS400
Subject: RE: [C400-L] Ebcdic2ascii

>Actually the fact, that count is a constant is probably the only
>reason for it to be non lvalue.
>I think, that if you will remove reference to variable count from the
>function "funct", compile the program (proably you will not get an
>error, and run the program in debug mode, you will be able to
>understand, if count is a constant or not, if it is a variable, it
>should be in stack, if constant - in program code segment. I recall
>that i hade similar errors with pointer to string.
>If you do it like:

>char *astring = "ABCDEFGH" ;

>then you cannot modify astring value, as it points to a constant...

on my visual c++ something like that will compile but an exception is thrown
when astring is modified.

better to code it as:
  const char* astring = "abc..." ;


This thread ...


Follow On AppleNews
Return to Archive home page | Return to MIDRANGE.COM home page

This mailing list archive is Copyright 1997-2020 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].