I want to add some code before every function call to do some checking. The only way I know is:
#define SOME_CODE printf("doing something...");
class testObject
{
void function1()
{
SOME_CODE
...
}
void function2()
{
SOME_CODE
...
}
}
Is there a cleaner way to achieve this? I'm looking for a method so I don't have add "SOME_CODE" to every function manually.
See Question&Answers more detail:os