dynamic-memory-allocation
Another dynamic memory allocation bug
I\'m trying to allocate memory for a multidimensional array (8 rows, 3 columns). Here\'s the code for the allocation (I\'m sure the error is clear for you)[详细]
2023-01-01 18:38 分类:问答Constructors for C++ objects
I have class Person as following : class Person { char* name; int age; }; Now I need to add two contructors. One taking no arguments, that inserts field values to dynamically allocated resources. S[详细]
2022-12-30 10:48 分类:问答Char * reallocation in C++
I need to store a certain amount of data in the \"char *\" in C++, because I wa开发者_开发技巧nt to avoid std::string to run out of memory, when exceeding max_size(). But the data comes in data blocks[详细]
2022-12-28 08:21 分类:问答Where does memory dynamically allocated reside?
We know that malloc() and new operation allocate memory from heap dynamically, but where does heap reside? Does each process have its own private heap in the namespace for dynamic allocation or the OS[详细]
2022-12-26 00:02 分类:问答alternative to strdup
I\'m writing a C++ class for a book that contains a name: class Book { private: char* nm; .......... ..开发者_运维百科..........[详细]
2022-12-22 18:14 分类:问答local and dynamic allocating
I have a tree and I want to release the allocated memory, but I face a problem thata pointer mayrefers to a variable tha开发者_如何学JAVAt isn\'t dynamically allocated,so how to know wether this point[详细]
2022-12-22 06:38 分类:问答C function: is this dynamic allocation? initializating an array with a changing length
Suppose I have a C function: void myFunction(..., int nObs){ int myVec[nObs] ; ... } Is myVec being dynamically allocated?nObs is not constant whenever myFunction is called.I ask because I am curre[详细]
2022-12-21 11:35 分类:问答What does this dynamic allocation do?
Today, I found out that you can write su开发者_如何学编程ch code in C++ and compile it: int* ptr = new int(5, 6);[详细]
2022-12-21 04:57 分类:问答posix_memalign for std::vector
Is there a way to posix_memalign a std::vector without creating a local instance of the vector first?[详细]
2022-12-21 03:16 分类:问答QList memory deallocation
I\'m trying to free memory after using QList, but it doesn\'t seem to work properly. Here\'s my code: QList<double> * myList;[详细]
2022-12-20 20:06 分类:问答
加载中,请稍侯......