Top "Malloc" questions

The malloc function performs dynamic memory allocation in C and is part of the standard library.

What is the difference between "new" and "malloc" and "calloc" in C++?

What is the difference between "new" and "malloc" and "calloc" and others in family? (When) Do I need anything other …

c++ memory-management malloc heap
Allocating memory for a Structure in C

I'm tasked to create a program which dynamically allocates memory for a structure. normally we would use x=malloc(sizeof(…

c malloc structure
Maximum memory which malloc can allocate

I was trying to figure out how much memory I can malloc to maximum extent on my machine (1 Gb RAM 160 …

c memory-management operating-system malloc cpu-architecture
malloc: *** error: incorrect checksum for freed object - object was probably modified after being freed

I have a big problem with my iOS App: it crashes sometimes without detailed debug error. The stack trace is …

ios objective-c c crash malloc
How to use realloc in a function in C

Building on what I learned here: Manipulating dynamic array through functions in C. void test(int data[]) { data[0] = 1; } int main(…

c arrays malloc
Assigning memory to double pointer?

I am having trouble understanding how to assign memory to a double pointer. I want to read an array of …

c string pointers malloc double-pointer
malloc(sizeof(int)) vs malloc(sizeof(int *)) vs (int *)malloc(sizeof(int))

I acknowledge that all three of these have a different meaning. But, I don't understand on what particular instances would …

c memory allocation malloc
How to find the cause of a malloc "double free" error?

I'm programming an application in Objective-C and I'm getting this error: MyApp(2121,0xb0185000) malloc: *** error for object 0x1068310: …

iphone objective-c memory-management malloc autorelease
Understanding "corrupted size vs. prev_size" glibc error

I have implemented a JNA bridge to FDK-AAC. Source code can be found in here When bench-marking my code, I …

c++ malloc free jna glibc
How do free and malloc work in C?

I'm trying to figure out what would happened if I try to free a pointer "from the middle" for example, …

c memory free malloc