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.)
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.)
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.
yes
[edit] damn, even with only 1 word to type, mitrmkar beat me to it
lol, thanks.
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.