Is there any situation where using a preprocessor is absolutely necessary?
and are they considered bad practice (like void main) to implement?
Is there any situation where using a preprocessor is absolutely necessary?
and are they considered bad practice (like void main) to implement?
I AM WINNER!!!1!111oneoneomne
>Is there any situation where using a preprocessor is absolutely necessary?
I don't know of any other way to create inclusion guards, so yes.
-Prelude
My best code is written with the delete key.
copy and paste the file to include!!! how efficient... lol
>>copy and paste the file to include!!!
>>how efficient... lol
Totally inefficient.
When all else fails, read the instructions.
If you're posting code, use code tags: [code] /* insert code here */ [/code]
>>copy and paste the file to include!!!
>>how efficient... lol
>Totally inefficient.
Totally stupid too.
-Prelude
My best code is written with the delete key.
btw, it was sarcasm..
>btw, it was sarcasm..
We know, but the urge to make a witty retort is often too much.
-Prelude
My best code is written with the delete key.
>>I don't know of any other way to create inclusion guards, so yes.<<
Prelude, I know this is probably clear as day to you but, for the rest of us, what on earth is creating inclusion guards?
[code]
#include <windows.h>
[\code]
Is this it?
>what on earth is creating inclusion guards?
Inclusion guards make sure that a header file cannot be included more than once, even if the source asks for it.
-PreludeCode:#ifndef SOME_WIERD_NAME_ #define SOME_WIERD_NAME_ // Do header type stuff #endif
My best code is written with the delete key.
and make sure if you use Prelude's you spell weird wrong both times
(i before e, except after C and where it changes with no reason, like in weird)
>and make sure if you use Prelude's you spell weird wrong both times
Yes, that's the key to making it work. I wood hav menchuned it urlier but I thot it wuz obveus.
(On a totally unrelated note, you can be more productive with copy paste...except when you make a boo-boo. )
-Prelude
My best code is written with the delete key.
I always just remember that "weird" is spelled weird.
bah, english blows.
You can output gcc -E foo.c to a file so that there
are no #'s. Then you can compile that---it's much better
than cut and paste.
aiight thanx... especially for the english lesson. I needed that
I AM WINNER!!!1!111oneoneomne
Preprocessors are needed for inclusion guards as said but they're also just a nice thing to have.
Now I know just about every C++ programmer other than me disagrees, but I like to use #definitions instead of constants and macros instead of inline functions.
A lot of people consider macros deprecated things, so I guess they'll be a day when the C++ doesn't support them anymore..