Skip to content

Instantly share code, notes, and snippets.

@fcamel
Created August 10, 2013 09:28
Show Gist options
  • Save fcamel/6199762 to your computer and use it in GitHub Desktop.
Save fcamel/6199762 to your computer and use it in GitHub Desktop.
#include <stdio.h>
#ifdef DEBUG_PRINT
#define DebugPrintf(format, args...) fprintf(stderr, "%s this=%p " format, __PRETTY_FUNCTION__, this, ##args)
#else
#define DebugPrintf(format, args...)
#endif
class Calculator
{
public:
int add(int a, int b)
{
DebugPrintf("a = %d, b = %d\n", a, b);
return a + b;
}
};
int main(void)
{
Calculator c;
printf("result: %d\n", c.add(2, 1));
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment