delete-operator
How to use delete with a variable pointed to by two pointers?
Let say I have a hypothetical pointer declared with new like so: int* hypothetical_pointer = new int; and create another hypothetical pointer, with the same value:[详细]
2023-01-30 03:35 分类:问答Deleting a pointer to an automatic variable [duplicate]
This question already has an answer here: W开发者_如何学运维hat is the behavior of "delete" with stack objects? [duplicate][详细]
2023-01-28 08:48 分类:问答Delete objects of incomplete type
This one made me think: class X; void foo(X* p) { delete p; } How can we possibly delete p if we do not even know whether X has visible destructor? g++ 4.5.1 gives three warnings:[详细]
2023-01-28 00:31 分类:问答What will happen if you delete this in C++ [duplicate]
This question already has answer开发者_开发技巧s here: Closed 12 years ago. Possible Duplicate: Is it OK to use “delete this” to delete the current object?[详细]
2023-01-27 05:53 分类:问答What are the dynamics of the C++ delete statement?
This is merely for curiosity sake because I have not used new and delete in c++ except for the most basic uses.[详细]
2023-01-26 20:11 分类:问答delete vs delete[] [duplicate]
This question already has answers here: 开发者_如何学运维Closed 12 years ago. Possible Duplicate:[详细]
2023-01-26 17:49 分类:问答Creating new pointer object in loop
Say I do something like this for(int i = 0; i < 10; i++) { //create a pointer object using new //use the object[详细]
2023-01-26 00:31 分类:问答Delete a pointer to pointer (as array of arrays)
I have this in my code: double** desc = new double* [size_out]; for (int i = 0; i < size_out; i++) desc[i] = new double [size_in];[详细]
2023-01-25 13:52 分类:问答Is it safe to delete a NULL pointer?
Is it safe to delete a NULL point开发者_运维百科er? And is it a good coding style?delete performs the check anyway, so checking it on your side adds overhead and looks uglier. A very good practice is[详细]
2023-01-25 11:46 分类:问答Deallocating memory
For a project I have to implement a bitset class. My code thus far is: Header File #ifndef BITSET_H_ #define BITSET_H_[详细]
2023-01-25 11:44 分类:问答