Yeah, alpha, header files are the most necessary uses for #define. Your welcome for the explanation.
Yeah, alpha, header files are the most necessary uses for #define. Your welcome for the explanation.
FAQ
"The computer programmer is a creator of universes for which he alone is responsible. Universes of virtually unlimited complexity can be created in the form of computer programs." -- Joseph Weizenbaum.
"If you cannot grok the overall structure of a program while taking a shower, you are not ready to code it." -- Richard Pattis.
You forgot about the bad, nasty macros that should be replaced with inline functions...I want to know why? thanks.
alpha, here are the reasons for using const instead of #define:
they obey the language's scoping rules
you can see them in the debugger
you can take their address if you need to
you can pass them by const-reference if you need to
they don't create new "keywords" in your program.
If you speak or are learning Spanish, check out this Spanish and English Dictionary, it is a handy online resource.
What happens is not as important as how you react to what happens. -Thaddeus Golas