dynamic-memory-allocation
Pimpl idiom without using dynamic memory allocation
we want to use pimpl idiom for certain parts of our project. These parts of the project also happen to be parts where dynamic memory allocation is forbidden and this decision is not in our control.[详细]
2023-02-09 05:04 分类:问答C++ - Dynamic memory allocation required memory
If I want to allocate memory dynamically to an int object, I can do this: int *x = new int; In this case, I know that the heap reseves 开发者_如何学C4-bytes of memory for an int object.[详细]
2023-02-07 03:58 分类:问答Dynamic memory allocation "delete"
If I allocated a memory location for an int object dynamically as follows: int *x = new int; After done with it, and want to free the memory on the heap, I开发者_如何学Go will do the following:[详细]
2023-02-07 03:57 分类:问答Read a file into a multidimensional array with dynamic allocation in C
How can I read the data from a file with structure like the one below into a multidimensional array of integers in C?[详细]
2023-02-06 13:20 分类:问答Dynamic Function Memory? C++
I\'ve been reading through some books, and when it comes to Class/Functions using P开发者_JAVA技巧ointers/Dynamic Memory (or heap or w/e they call it) I start to get confused.[详细]
2023-02-06 05:04 分类:问答CUDA allocate memory in __device__ function
Is there a way in CUDA to allocate memory dynamically in device-side functions ? I could not find any examples of doing this.[详细]
2023-02-05 06:48 分类:问答realloc() without assignment problem
One of my classmates sent me a code and asked what was wrong with it. It was something like this: #include <stdio.h>[详细]
2023-02-03 03:52 分类:问答How to get size of different kinds of types in the same function using C?
I\'m writing a function which increases the size of a dynamic memory object created with malloc. The function should as arguments take a pointer to the memory block to be increased, the current size o[详细]
2023-02-02 17:00 分类:问答Initializing a dynamic memory array in a class
I am new to c++ programming, and this is probably a trivial problem, but I need to construct a variable sized array in a class and transfer text file data into it, see below. Here HISTORYFile >>[详细]
2023-01-31 02:54 分类:问答realloc()/HeapRealloc() fails even though enough memory is available
My machine h开发者_开发百科as 8GB of RAM and is running Windows Server 2008. malloc()/realloc() fails to allocate more memory when my application has 1.5~1.7GB already allocated. I tried switching to[详细]
2023-01-29 04:54 分类:问答