Path: utzoo!attcan!uunet!mcsun!ukc!edcastle!ecsv38 From: ecsv38@castle.ed.ac.uk (S Manoharan) Newsgroups: comp.lang.c++ Subject: Re: #defines.... Message-ID: <5005@castle.ed.ac.uk> Date: 3 Jul 90 16:09:37 GMT References: <37786@genrad.UUCP> Reply-To: ecsv38@castle.ed.ac.uk (S Manoharan) Organization: Dept of Computer Science, University of Edinburgh Lines: 13 In article <37786@genrad.UUCP> slp@genrad.genrad.COM (Steven L. Peters) writes: >have to. I'm wondering if you ever have to. I can't think of a >single time where you would be forced to use a #define over const or >inline... 1. To avoid multiple inclusion of header files. 2. Macros local to a function. As in: #define _C(i,j) ( *(C + nelements * i + j) ) where C is ptr, and _C(i, j) defines element [i, j] of an array. Note that an inline can't be local to a function. Mano.