Evan Brodie
2010-05-22 05:21:24 UTC
Hi,
When I was reading the course guidelines for C++ programming, I came
across a section that says: In this course, global macros and types
are allowed, while global variables are strongly discouraged.
As far as I understand, a global macro is written near the beginning
of the file (before our routines) as #define MY_PI = 3.14. This will
serve like a global constant, which could be written as const int
MY_PI = 3.14
Can someone please let me know if my analysis is accurate and please
fill me in on the differences between a macro and a global variable/
constant?
Thanks in advance.
Evan
When I was reading the course guidelines for C++ programming, I came
across a section that says: In this course, global macros and types
are allowed, while global variables are strongly discouraged.
As far as I understand, a global macro is written near the beginning
of the file (before our routines) as #define MY_PI = 3.14. This will
serve like a global constant, which could be written as const int
MY_PI = 3.14
Can someone please let me know if my analysis is accurate and please
fill me in on the differences between a macro and a global variable/
constant?
Thanks in advance.
Evan