0 hacker9801 49 9 Years Ago If you use the new operator on a class, say class dummy { public: string f; }; int main(int argc, char *argv[]) { dummy *p = new dummy; return 0; } do you have to use the delete operator on p ? (since, apparently, it utilizes new.) c++
1 Featured Reply mitrmkar 1,056 9 Years Ago If you use the new operator on a class, say class dummy { public: string f; }; int main(int argc, char *argv[]) { dummy *p = new dummy; return 0; } do you have to use the delete operator on p ? (since, apparently, it utilizes new.) Yes, when you want to release that memory, 'delete' needs to be issued. Votes + Comments Salem: Yes indeed
1 Featured Reply Nick Evan 4,005 9 Years Ago yes [edit] damn, even with only 1 word to type, mitrmkar beat me to it Votes + Comments Salem: You shouldn't have wasted your time spell checking it then ;)