#define y(a, b) ((a)+(b)) /* adds a and b */
#define x y
x(1, 2); /* error */
Name:
Anonymous2008-02-02 22:22
>>9
Define them in reverse order and it works. The C preprocessor is a filthy hack.
Name:
Anonymous2008-02-02 22:34
>>10
No, it's not a filthy hack, please don't repeat things you've heard on IRC channels or blogs. It's *you* who does not know C (nor how the preprocessor treats tokens)
>>15 no, not really I remember it from poe's story, ``the cask of amontillado"
Name:
Anonymous2008-02-03 0:06
>>11
The point is that comparing CPP's #defines (which are crappy macros largely inferior to the macros in CL) to Scheme's (defines) (which are fucking FUNCTIONS) is absolutely retarded. >>8 is a complete moron who read the word "define" and assumed that it must be the same thing as C's macros.
Name:
Anonymous2008-02-03 0:32
The function will return at the end irregardless of whether a return statement is present. So unless you plan to be using the return value for something, it's unnecessary.
\n saves a few extra characters when it's the last thing to be output in a string, but otherwise endl is easier to type.
cout << "my other car is a cdr.\n"
vs cout << "number of scientologists killed: " << victims << endl;
BUT IT DOESN'T MATTER, YOU SHOULD BE USING printf()
Name:
Anonymous2008-02-03 1:17
>>SHOULD BE USING printf()
/thread
also notice my lack of EXPERT QUOTES
Name:
Anonymous2008-02-03 1:18
[quote]also notice my lack of EXPERT QUOTES[/quote]
I did. Go and lern2BBCode
Name:
Anonymous2008-02-03 1:32
>>18 The function will return at the end irregardless of whether a return statement is present. So unless you plan to be using the return value for something, it's unnecessary.
It's not about whether or not it returns, it's what it returns. The real reason people leave it out is because the compiler will include it for you if it's omitted. No other function gets this special treatment.