Click here to Skip to main content
15,887,214 members
Home / Discussions / C / C++ / MFC
   

C / C++ / MFC

 
GeneralRe: how the macro works Pin
CPallini12-Dec-07 1:56
mveCPallini12-Dec-07 1:56 
GeneralRe: how the macro works Pin
George_George12-Dec-07 2:03
George_George12-Dec-07 2:03 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:12
toxcct12-Dec-07 2:12 
JokeRe: how the macro works Pin
CPallini12-Dec-07 2:23
mveCPallini12-Dec-07 2:23 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:30
toxcct12-Dec-07 2:30 
JokeRe: how the macro works Pin
CPallini12-Dec-07 2:44
mveCPallini12-Dec-07 2:44 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:48
toxcct12-Dec-07 2:48 
AnswerRe: how the macro works [modified] Pin
toxcct12-Dec-07 0:50
toxcct12-Dec-07 0:50 
the , operator returns the last of its statements.
here, the macro calls the Foo function, to which the counter variable is passes by pointer (so, the counter variable is modified from within the Foo() function, but its modifications are still visible from the caller).
then, the counter variable is return (and as there is no = operator in the instruction GETFOO;, the returned value is not used, but still the counter variable is assigned with 100.

writing GETFOO; here is as if you were doing Foo(&counter);

BTW, this is very awful coding, and you should never use such macros !

and to finish, a question: how old are you ?


modified on Wednesday, December 12, 2007 8:01:42 AM

GeneralRe: how the macro works Pin
George_George12-Dec-07 0:59
George_George12-Dec-07 0:59 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:01
toxcct12-Dec-07 2:01 
JokeRe: how the macro works Pin
Cedric Moonen12-Dec-07 2:10
Cedric Moonen12-Dec-07 2:10 
JokeRe: how the macro works Pin
toxcct12-Dec-07 2:13
toxcct12-Dec-07 2:13 
GeneralRe: how the macro works Pin
George_George12-Dec-07 2:35
George_George12-Dec-07 2:35 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:38
toxcct12-Dec-07 2:38 
AnswerRe: how the macro works Pin
Iain Clarke, Warrior Programmer12-Dec-07 1:42
Iain Clarke, Warrior Programmer12-Dec-07 1:42 
GeneralRe: how the macro works Pin
CPallini12-Dec-07 1:59
mveCPallini12-Dec-07 1:59 
GeneralRe: how the macro works Pin
George_George12-Dec-07 2:00
George_George12-Dec-07 2:00 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:09
toxcct12-Dec-07 2:09 
GeneralRe: how the macro works Pin
George_George12-Dec-07 2:18
George_George12-Dec-07 2:18 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:21
toxcct12-Dec-07 2:21 
GeneralRe: how the macro works Pin
Cedric Moonen12-Dec-07 2:24
Cedric Moonen12-Dec-07 2:24 
GeneralRe: how the macro works Pin
toxcct12-Dec-07 2:27
toxcct12-Dec-07 2:27 
JokeRe: how the macro works Pin
CPallini12-Dec-07 2:58
mveCPallini12-Dec-07 2:58 
GeneralRe: how the macro works Pin
CPallini12-Dec-07 2:36
mveCPallini12-Dec-07 2:36 
GeneralRe: how the macro works Pin
Iain Clarke, Warrior Programmer12-Dec-07 2:48
Iain Clarke, Warrior Programmer12-Dec-07 2:48 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.