Gee, thanks. But Bjarne Stroustrup was probably writing
about C++, which
allows constants to be associated with a class:
const double Synth::DEFAULT_FRAME_RATE = 44100.0;
For C++, this construct is preferable to using a #define because the scope
is limited to the class and would not conflict with, for example:
const double Video::DEFAULT_FRAME_RATE = 30.0;
That is a great feature of C++ but PortAudio is using 'C' not C++. So I
think our only choices are #define and enum. PortAudio uses both.
http://www.portaudio.com/docs/v19-doxydocs/portaudio_8h.html
Are enums better than #defines?? I am always trying to improve my 'C' chops
so I am open to suggestions.
the objections you raise apply to #define's and enums as well. they
are just as subject to namespace collisions as other names, hence the
C habit of:
#define __some_unique_prefix__now_the_real_part__ ...
the major benefit of using constants is type-safety.