i understand that the macro is a code that is changed before compile it.
so i did these macro with these code:
#define (events2((y),(x))) (class events3 : public ( y ) { events3(); ~events3(); }(x) ; )
//#define (events2((y),(x))) (class events3 : public ( y ) { events3(); }(x) ; )
//#define (events2((y),(x))) (class events3 : public ( y ) { ~events3(); }(x) ; )
//#define (events2((y),(x))) (class events3 : public ( y ) { }(x) ; )
class b
{
public:
virtual void tests(){};
b()
{
tests();
}
};
events2( b) a;
void a::tests()
{
write("oi");
}
and i get these errors:
"C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|7|error: macro names must be identifiers|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|23|error: expected constructor, destructor, or type conversion before 'a'|
C:\Users\Joaquim\Documents\CodeBlocks\My Class\main.cpp|25|error: 'a' has not been declared|
||=== Build finished: 3 errors, 0 warnings (0 minutes, 0 seconds) ===|"
what i'm doing wrong with these macro?