If this is your first visit, be sure to
check out the FAQ by clicking the
link above. You may have to register
before you can post: click the register link above to proceed. To start viewing messages,
select the forum that you want to visit from the selection below.

PS:- How comes copy/paste from my msvc9 express ruins all indentation. Ive set to use spaces instead of tabs like on all previous versions but my code never cut/pastes properly??

Get Microsoft Visual C++ Express here or CodeBlocks here.
Get STLFilt here to radically improve error messages when using the STL.
Get these two can't live without C++ libraries, BOOST here and Loki here.
Check your code with the Comeau Compiler and FlexeLint for standards compliance and some subtle errors. Always use [code] code tags [/code] to make code legible and preserve indentation.Do not ask for help writing destructive software such as viruses, gamehacks, keyloggers and the suchlike.

Re: Using delete on an object without new

Originally Posted by exterminator

One ocassion where in I wanted something like that was when I had 2 code paths and each led to either a pointer to an object on the stack or the free-store and it was a tough to find out when it was pointing to what and correspondingly choose to call delete or not (without adding a state).

you're only getting yourself into problems with that type of model.
It's easy to work around. One method: prevent local copies (make the constructors private) and have a static object creation function.

Re: Using delete on an object without new

all i know is i was given this code and was told to make it work by creating my own X class that's it!

Please tell your instructor/teacher he is an idiot.
Tell him I said so.
And tell him to come here to come explain in what even remotely realistic setting this is ever going to be an actual need.

Other than "syntax games" (which really has NOTHING to do with C++ at all) there is no reason to ever do something like this. If this is part of a C++ curriculum other than training in said "syntax games", I stand by my statement he's an idiot.

Re: Using delete on an object without new

Please tell your instructor/teacher he is an idiot.
Tell him I said so.
And tell him to come here to come explain in what even remotely realistic setting this is ever going to be an actual need.

Other than "syntax games" (which really has NOTHING to do with C++ at all) there is no reason to ever do something like this. If this is part of a C++ curriculum other than training in said "syntax games", I stand by my statement he's an idiot.

Hopefully, after 5 years the instructor has moved on and out of programming.

All advice is offered in good faith only. You are ultimately responsible for effects of your programs and the integrity of the machines they run on.

* The Perfect Platform for Game Developers: Android
Developing rich, high performance Android games from the ground up is a daunting task. Intel has provided Android developers with a number of tools that can be leveraged by Android game developers.

* The Best Reasons to Target Windows 8
Learn some of the best reasons why you should seriously consider bringing your Android mobile development expertise to bear on the Windows 8 platform.