Function call or variable? 
Author Message
 Function call or variable?


:   > Not necessarily.  You could use #define to ensure that the program is
:   > changed in only one place.  I don't believe I've ever seen any C code
:   > that's designed like this, though.
:
:   No, no, no.  I have seen C code like this, and I have seen people
: use #defines to change things.  And I have seen the code compile
: cleanly and work in simple cases but break horribly later.

These days any sensible C programmer uses "const", not "#define".
Avoids headaches without aspirin.
--
-------------------------------------------------------------------------------
John English                    | "There are basically two types of{*filter*}s,
Dept. of Computing              |  hard{*filter*}s and floppy{*filter*}s."
University of Brighton          |    -- from a student essay on storage media

Fax:    0273 642405             |    -- from one of my lectures (on a bad day)
-------------------------------------------------------------------------------



Sun, 10 Sep 1995 00:02:13 GMT  
 Function call or variable?

   John English by the way he quoted me seems to imply that I was
endorsing #define, when actually we are in {*filter*} argeement.  I also
agree that there exist sensible C programmers--not that there are many
of them. :-)

   However, const does come with a different set of potential
problems, it is just a much smaller set.  (The watch it! involves
consts included in different modules, whose values depend on
globals...  There is no guarentee that the const will evaluate the
same in every unit.  Another one of those C "features" where good
library management discipline is essential.)

--

                                        Robert I. Eachus

with Standard_Disclaimer;
use  Standard_Disclaimer;
function Message (Text: in Clever_Ideas) return Better_Ideas is...



Sun, 10 Sep 1995 10:10:31 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. indirect function calls and variable variables

2. indirect function calls and variable variables

3. Function call or variable?

4. VC++ calling fortran function and fortran function calling a c++ function

5. How to find out name of calling function from called function

6. calling function recursively, local variables?

7. Local variables, call-back functions under Windows

8. evaluating a variable as a function call?

9. calling a variable from a separate function

10. Call a function using a variable

11. How update variable values by calling secondary functions ?

12. variable function call

 

 
Powered by phpBB® Forum Software