Category "malloc"

what is the upper limit for process heap memory? [duplicate]

Hi Anybody knows what is the upper limit for the heap allocation in linux process? Consider below example, int main() { char *p; unsig

How to free a malloc 2D array in C initialiszed in this way?

I have declared a 2D malloc array like this in C: int** pArray; int i; pArray=(int**)malloc(pRows*sizeof(int*)); for(i=0;i<pRows;i++)

My code runs smoothly to the end in Linux but ends abruptly in Windows

I am new to coding. As a practice problem, I wrote a program to sort strings as alphabetically, as in a dictionary. My program takes as input: (a) The number o

Replacing malloc() with my own implementation

I need a fast malloc() / free() replacement. There's mimalloc vom Microsoft Research which is actually on average the fastest malloc()- / free()-replacement. I'

is there a way to use fgets size dynamically

So im learning about pointers and dynamic memory and how am experimenting with fgets. So i want to take in a string input into a pointer using fgets, but i want

why does malloc not taking in the full text? [duplicate]

Why is it when I try to take in a text in the variable is does not store in the full sentence. The malloc seems to not allocate enough memory