First C program

Frank Kolmann <[email protected]>
Newsgroups gmane.comp.lang.as400.c
Message-ID <CAB-SQvjhPGXwsiG4PimywtZM0_YU3gbiPot5RXDKwJWWJCrDLA@mail.gmail.com>
Hi Barbara

Thank you. Yes I am guilty, I fell into a C pitfall.  Also Paul warns
against this problem.

However I am not sure how I should code this.
I guess it should be
#define I03 2
which sets up array index 2 to look up the Indicator area.

Frank
>On 2014-04-01 04:46, frank kolmann wrote:
>I have coded my first C program.
>
>One thing I noticed is that you have a numeric constant starting with zero.
>
>#define I03 02
>
>In C, when a numeric constant starts with zero, it's an octal constant (base 8). You're ok with 02 since it means 2 in both decimal and octal.
>
>But if was a constant like 023, it would be 19 in octal (2*8 + 3)
>
>Barbara Morris
-- 
This is the Bare Metal Programming IBM i (AS/400 and iSeries) (C400-L) mailing list
To post a message email: C400-L-Zwy7GipZuJhWk0Htik3J/[email protected]
To subscribe, unsubscribe, or change list options,
visit: http://lists.midrange.com/mailman/listinfo/c400-l
or email: C400-L-request-Zwy7GipZuJhWk0Htik3J/[email protected]
Before posting, please take a moment to review the archives
at http://archive.midrange.com/c400-l.
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.