Would you consider this to be destructive to programmers' sanity:
#define main Main
#define cout cerr
#define while(x) if(x)
#define class union
#define true 0
#define false 1
Comments welcome!!! 14 2038
Protoman wrote: Comments welcome!!!
I completely have no idea what is that for but if you like
comments here you have mine :-)
#define while(x) if(x)
Here you can not prevent programmer to use expression
which result does not make any sense in term of boolean.
Cheers
--
Mateusz Łoskot http://mateusz.loskot.net
#define while(x) if(x) means that the preprocessor will substitute
if(x) for any occurance of while(x).
Protoman wrote: #define while(x) if(x) means that the preprocessor will substitute if(x) for any occurance of while(x).
What for?
Do you want to do some test cases or what?
Cheers
--
Mateusz Łoskot http://mateusz.loskot.net
At my work, there's this person who upsets and annoys *everyone*, me,
my bosses, their bosses, the secretaries, absolutely everyone. He's a
grade A psycho. He's also *extremely* arrogant. He keeps trying to get
me and my other coworkers fired; he's even tried once to get my boss
and his boss fired. We're all going to get him with this. Do you know
any other ways of sabotaging his project (BTW, my boss has decided to
cancel the project; he's informed everyone but the man in question, [my
boss plans on firing him later this month] so it doesn't matter; he's
sanctioning this)?
Protoman wrote: At my work, there's this person who upsets and annoys *everyone*, me, my bosses, their bosses, the secretaries, absolutely everyone. He's a grade A psycho. He's also *extremely* arrogant. He keeps trying to get me and my other coworkers fired; he's even tried once to get my boss and his boss fired. We're all going to get him with this. Do you know any other ways of sabotaging his project (BTW, my boss has decided to cancel the project; he's informed everyone but the man in question, [my boss plans on firing him later this month] so it doesn't matter; he's sanctioning this)?
Sounds more like a kindergarden. How old are you kid - 15 or 16?
Protoman wrote in message
<11**********************@g43g2000cwa.googlegroups .com>... At my work, there's this person who upsets and annoys *everyone*, me, my bosses, their bosses, the secretaries, absolutely everyone. He's a grade A psycho. He's also *extremely* arrogant. He keeps trying to get me and my other coworkers fired; he's even tried once to get my boss and his boss fired. We're all going to get him with this. Do you know any other ways of sabotaging his project (BTW, my boss has decided to cancel the project; he's informed everyone but the man in question, [my boss plans on firing him later this month] so it doesn't matter; he's sanctioning this)?
Write a program that will go through his code files and replace all
semi-colons(;) with colons(:). Remove all the 'virtual' from his base class
destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
--
Bob R
POVrookie
BobR wrote: Write a program that will go through his code files and replace all semi-colons(;) with colons(:). Remove all the 'virtual' from his base class destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
-- Bob R POVrookie
For the first one, how do I do the virtual thing? I know how to do the
semicolon one, #define ; :. As for the second item please define "get".
That makes me uncomfortable. As for the guy, he's even more infuriating
then my PHB.
Protoman wrote: BobR wrote:
Write a program that will go through his code files and replace all semi-colons(;) with colons(:). Remove all the 'virtual' from his base class destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
-- Bob R POVrookie
For the first one, how do I do the virtual thing? I know how to do the semicolon one, #define ; :. As for the second item please define "get". That makes me uncomfortable. As for the guy, he's even more infuriating then my PHB.
Sounds like you're jealous of him because he actually knows C++. I hope
you're not employed as a C++ guy there if you don't even understand
virtual destructors in abstract base classes.
I hope that your co-worker finds your messages and takes legal action
against you.
puzzlecracker wrote: Sounds more like a kindergarden. How old are you kid - 15 or 16?
Don't you know? Protoman's a JPL Rocket Scientist(TM), or so he claimed
at one point.
BobR wrote: Write a program that will go through his code files and replace all semi-colons(;) with colons(:). Remove all the 'virtual' from his base class destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
-- Bob R POVrookie
Please define "get"; you're making me uncomfortable. And I forgot, what
exactly will removing virtuality accomplish? Make his objs destruct
improperly?
Protoman wrote: At my work, there's this person who upsets and annoys *everyone*, me, my bosses, their bosses, the secretaries, absolutely everyone. He's a grade A psycho. He's also *extremely* arrogant. He keeps trying to get me and my other coworkers fired; he's even tried once to get my boss and his boss fired. We're all going to get him with this. Do you know any other ways of sabotaging his project (BTW, my boss has decided to cancel the project; he's informed everyone but the man in question, [my boss plans on firing him later this month] so it doesn't matter; he's sanctioning this)?
No more questions and comments from my side :-)
Cheers
--
Mateusz Łoskot http://mateusz.loskot.net
"Protoman" <Pr**********@gmail.com> wrote in message
news:11**********************@g43g2000cwa.googlegr oups.com... At my work, there's this person who upsets and annoys *everyone*, me, my bosses, their bosses, the secretaries, absolutely everyone. He's a grade A psycho. He's also *extremely* arrogant. He keeps trying to get me and my other coworkers fired; he's even tried once to get my boss and his boss fired. We're all going to get him with this. Do you know any other ways of sabotaging his project (BTW, my boss has decided to cancel the project; he's informed everyone but the man in question, [my boss plans on firing him later this month] so it doesn't matter; he's sanctioning this)?
Fortunately for you that's all a bunch of bull (since, if I recall, you're
still in school). If the above were true, you'd have just provided public
documentation for the lawsuit he'd be sure to file.
Now go troll elsewhere.
Protoman wrote in message
<11**********************@g44g2000cwa.googlegroups .com>... BobR wrote: Write a program that will go through his code files and replace all semi-colons(;) with colons(:). Remove all the 'virtual' from his base
class destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
-- Bob R POVrookie
Please define "get"; you're making me uncomfortable. And I forgot, what exactly will removing virtuality accomplish? Make his objs destruct improperly?
The "get" refers to pulling a prank, getting even, etc.
Try the following:
#include <iostream>
class Base1 { public:
~Base1(){ std::cout << "~Base1()\n";}
};
class Derived1 : public Base1 { public:
Derived1(){ std::cout << "Derived1()\n";
array = new char[1024 * 1024];
}
~Derived1(){ std::cout << "~Derived1()\n";
delete [] array;
}
private:
char *array;
};
int main() {
Base1* bp = new Derived1; // Upcast
delete bp;
return 0;
}
Run it, then change:
~Base1(){ std::cout << "~Base1()\n";}
to:
virtual ~Base1(){ std::cout << "~Base1()\n";}
....and run it again. Your findings?
--
Bob R
POVrookie
BobR wrote: Protoman wrote in message <11**********************@g44g2000cwa.googlegroups .com>... BobR wrote: Write a program that will go through his code files and replace all semi-colons(;) with colons(:). Remove all the 'virtual' from his base class destructors.
Or, for the best way to 'get' the guy, BE NICE TO HIM!!! Extremely nice!
-- Bob R POVrookie
Please define "get"; you're making me uncomfortable. And I forgot, what exactly will removing virtuality accomplish? Make his objs destruct improperly?
The "get" refers to pulling a prank, getting even, etc.
Try the following:
#include <iostream> class Base1 { public: ~Base1(){ std::cout << "~Base1()\n";} };
class Derived1 : public Base1 { public: Derived1(){ std::cout << "Derived1()\n"; array = new char[1024 * 1024]; } ~Derived1(){ std::cout << "~Derived1()\n"; delete [] array; } private: char *array; };
int main() { Base1* bp = new Derived1; // Upcast delete bp; return 0; }
Run it, then change:
~Base1(){ std::cout << "~Base1()\n";} to: virtual ~Base1(){ std::cout << "~Base1()\n";}
...and run it again. Your findings?
-- Bob R POVrookie
Derived's dtor never got called w/o virtuality... excellent... What
about :
#define DEBUG 1
#if DEBUG==1
//all header files and declarations/definitions, etc
#endif
Lets say someone resets debug to 0... This discussion thread is closed Replies have been disabled for this discussion. Similar topics
205 posts
views
Thread by Jeremy Siek |
last post: by
|
24 posts
views
Thread by Nudge |
last post: by
|
16 posts
views
Thread by Trying_Harder |
last post: by
|
13 posts
views
Thread by seemanta dutta |
last post: by
|
18 posts
views
Thread by /* frank */ |
last post: by
|
13 posts
views
Thread by Chris Croughton |
last post: by
|
9 posts
views
Thread by Walter Roberson |
last post: by
|
2 posts
views
Thread by Paolo |
last post: by
|
32 posts
views
Thread by spibou |
last post: by
|
31 posts
views
Thread by Sam of California |
last post: by
| | | | | | | | | | |