T *foo = new T;

Pages: 12
This ain't java
Did the OP do a runner??

Andy

Last edited on
nope
What is this about? There's no question.
MrT * Baracas = new MrT;

Only when the plan comes together.
What's worse is when professors require students to do this "in order to learn pointers".
1
2
3
4
5
6
7
8
9
10
11
12
13
MrsT* margaret = new MrsT;

margaret->BuildUp();

try {
   margaret->RunTheUK();
}
catch(const std::popularity_error&) {
}

margaret->TearDown();
   
delete margaret;

Last edited on
I've got to guess the first post is missing.
According to the first post I can see, did someone actually try to do this in java??
@EssGeEich: nope.
@Smac89: java is so stupid that you need to tell it twice what do you want.
@Duoas: I don't get it.

Another gem
delete new T;
@ne555 I believe Duoas is referencing the 2010 A-Team film (There is no Plan B) in which Baracus (one of the characters) isn't played by Mr.T (as he originally was in the tv show).
Last edited on
Uhm then I'm guessing you're looking for reasons why new sucks?
I'm confused about this thread.
No, seriously, what's going on in this thread?
Hpw are you all that confused about this thread? It's clearly just ne555 conveying his annoyance at so many people improperly using new.
T* ne555 = new T ;

Now you've all seen ne555 newd.
Baracas->AintGettingOnNoPlaneCrazyFool();
I'd say this particular niche of misuse is more commonly known as useless use.
http://partmaps.org/era/unix/award.html
This ain't java
No, it isn't. It's C++.

┬┐Is there any reason to mention it?

I mean if a programmer didn't program anything but java, he might not even know what a pointer is...
until he/she gets a null pointer exception :)
Pages: 12