#define this THIS
Using "this" directly is not a frequent occurence in C++. As long as you don't, the above think will work. And if you do, you can always say
#undef this
before and
#define this THIS
after.
Can you say code obfuscation? I knew you could.
Edit: btw, in a cource on OO in C++, this deserves an F, not an A.
8<-------------------------------------------
#include <stdio.h>
#define this THIS
class A {
public:
A() : this(10){}
void printThis() {
printf("%d\\n", this);
}
private:
int this;
};
int main(int argc, char *argv[]) {
A a;
a.printThis();
}
--
"...was poorly, lugubrious and intoxicated."
-- Patrick O'Brian, "Master and Commander"
Edited by
Arkadiy
July 26, 2004, 05:13:52 PM EDT
#define this THIS
Using "this" directly is not a frequent occurence in C++. As long as you don't, the above think will work. And if you do, you can always say
#undef this
before and
#define this THIS
after.
Can you say code obfuscation? I knew you could.
8<-------------------------------------------
#include <stdio.h>
#define this THIS
class A {
public:
A() : this(10){}
void printThis() {
printf("%d\n", this);
}
private:
int this;
};
int main(int argc, char *argv[]) {
A a;
a.printThis();
}
--
"...was poorly, lugubrious and intoxicated."
-- Patrick O'Brian, "Master and Commander"