delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/02/04/08:44:20

X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f
Lines: 20
X-Admin: news AT aol DOT com
From: sterten AT aol DOT com (Sterten)
Newsgroups: comp.os.msdos.djgpp
Date: 04 Feb 2004 13:09:48 GMT
References: <uptcv9jmy DOT fsf AT elta DOT co DOT il>
Organization: AOL Bertelsmann Online GmbH & Co. KG http://www.germany.aol.com
Subject: Re: array indices [i][j]
Message-ID: <20040204080948.20033.00001476@mb-m17.aol.com>
To: djgpp AT delorie DOT com
DJ-Gateway: from newsgroup comp.os.msdos.djgpp
Reply-To: djgpp AT delorie DOT com

>>  >  #define MA(i,j,k) A[i][j][k]
>>  >
>>  >(note the use of parentheses instead of square brackets), or a similar
>>  >definition of an inline function.
>> 
>> very good !
>
>Actually, not very good because using macros to change a syntactic
>appearance of a programming language is generally a bad habit.  For
>starters, people who read your program will have difficulty
>understanding the code.  And you yourself prevent yourself from
>learning C faster.


I assume that the compiler first translates the #define 's
into another  source code file  S  and then processes
S in a second step.
So, can I code with macros and then make the compiler
output the preprocessed file S also, so that everyone
can have the source without macros, if he wants ?

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019