delete-operator
Should I call class destructor in this code?
I am using this sample to decode/encode some data I am retrieving/sending from/to a web server, and I want to use it like this:[详细]
2022-12-31 16:50 分类:问答What's the equivalent of new/delete of C++ in C?
What\'s the equivalent of new/delete of C++ in C? Or it\'s the s开发者_开发百科ame in C/C++?There\'s no new/delete expression in C.[详细]
2022-12-31 09:46 分类:问答C++ Array of pointers: delete or delete []?
Cosider the following code: class Foo { Monster* monsters[6]; Foo() { for (int i = 0; i < 6; i++) { monsters[i] = new Monster();[详细]
2022-12-30 03:28 分类:问答Object Deletion: use parent or not
Which one do you prefer to delete objects? Especially in QT, but other practices are also welcome. These two alternatives seem same to me, are they?[详细]
2022-12-29 06:15 分类:问答Test, if object was deleted
Look to the following code, please: class Node { private: double x, y; public: Node (double 开发者_开发知识库xx, double yy): x(xx), y(yy){}[详细]
2022-12-28 18:51 分类:问答C++ delete[] operator [duplicate]
This question already has answers here: How does delete[] "know" the size of the operand array?[详细]
2022-12-28 16:22 分类:问答C++ delete static_cast<void*> (pointer) behavior
suppose the code does the following: T *pointer = new T(); delete static_cast<void*>(pointer); what is result?Undefined, memo开发者_JAVA百科ry leak, memory is deleted?The behavior is undefine[详细]
2022-12-28 07:01 分类:问答Dynamic array of template objects in C++
#include <vector> using namespace std; int main(开发者_C百科) { vector<int> *list = new vector<int>[33];[详细]
2022-12-27 13:40 分类:问答C++ delete not working?
I am having a problem with delete and destructor (I am sure I am making a stupid mistake here, but haven\'t been able to figure it out as of yet).[详细]
2022-12-27 11:44 分类:问答Deleting a non-owned dynamic array through a pointer
I\'m relatively novice when it comes to C++ as I was weened on Java for much of my undergraduate curriculum (tis a shame). Memory management has been a hassle, but I\'ve purchased a number books on an[详细]
2022-12-26 05:18 分类:问答
加载中,请稍侯......