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 2205
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 thread has been closed and replies have been disabled. Please start a new discussion. Similar topics
by: Jeremy Siek |
last post by:
CALL FOR PAPERS/PARTICIPATION
C++, Boost, and the Future of C++ Libraries
Workshop at OOPSLA
October 24-28, 2004
Vancouver, British Columbia, Canada
http://tinyurl.com/4n5pf
Submissions
|
by: Nudge |
last post by:
I have an array, and an unrolled loop which looks like this:
do_something(A);
do_something(A);
....
do_something(A);
I thought: why should I type so much? I should write a macro.
So I was...
|
by: Trying_Harder |
last post by:
Is it possible to redefine a macro with global scope after
undefining it in a function? If yes, could someone explain
how?
/If/ my question above isn't very clear you can refer to
the...
|
by: seemanta dutta |
last post by:
Greetings C gurus,
I have used preprocessor directives since a very long time. But
whenever I see some professional piece of C code, the linux kernel for
example, I get literally confused by the...
|
by: /* frank */ |
last post by:
My teacher said that array in C is managed by preprocessor.
Preprocesser replace all array occurences (i.e. int a ) with
something that I don't understand/remember well.
What's exactly happens...
|
by: Chris Croughton |
last post by:
Is the following code standard-compliant, and if so what should it do?
And where in the standard defines the behaviour?
#include <stdio.h>
#define DEF defined XXX
int main(void)
{
int...
|
by: Walter Roberson |
last post by:
I have run into a peculiarity with SGI's C compiler (7.3.1.2m). I have been
reading carefully over the ANSI X3.159-1989 specification, but I cannot
seem to find a justification for the behaviour....
|
by: Paolo |
last post by:
I imported a VC++6.0 project into VC++7.1. The conversion operation makes a mess with Preprocessor Definitions, adding a "$(NoInherit)" for each file.
For example: I had a DLL project in VC++6.0...
|
by: spibou |
last post by:
Is the output of the C preprocessor deterministic ? What I mean
by that is , given 2 compilers which conform to the same standard,
will their preprocessors produce identical output given as input...
|
by: Sam of California |
last post by:
Is it accurate to say that "the preprocessor is just a pass in the parsing
of the source file"?
I responded to that comment by saying that the preprocessor is not just a
pass. It processes...
|
by: Mushico |
last post by:
How to calculate date of retirement from date of birth
|
by: DJRhino |
last post by:
Was curious if anyone else was having this same issue or not....
I was just Up/Down graded to windows 11 and now my access combo boxes are not acting right. With win 10 I could start typing...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM)
The start time is equivalent to 19:00 (7PM) in Central...
|
by: Aliciasmith |
last post by:
In an age dominated by smartphones, having a mobile app for your business is no longer an option; it's a necessity. Whether you're a startup or an established enterprise, finding the right mobile app...
|
by: tracyyun |
last post by:
Hello everyone,
I have a question and would like some advice on network connectivity. I have one computer connected to my router via WiFi, but I have two other computers that I want to be able to...
|
by: giovanniandrean |
last post by:
The energy model is structured as follows and uses excel sheets to give input data:
1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
|
by: NeoPa |
last post by:
Hello everyone.
I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report).
I know it can be done by selecting :...
|
by: NeoPa |
last post by:
Introduction
For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
|
by: isladogs |
last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM)
Please note that the UK and Europe revert to winter time on...
| |