Bhai ye dynamic memory allocation concept mey malloc or realloc met kya difference he ??
@nirgandhi97884 жыл бұрын
When malloc is used the memory stored in it stays in the heap of the program until it is been free with a code free(), while alloc itself clears out when the function is used and returned...
@AbhishekMishra-mu2yn4 жыл бұрын
@@nirgandhi9788 I know it ..but in term of memory allocation..what is difference ??
@nirgandhi97884 жыл бұрын
Malloc acquires single argument for allocation while alloc requires two...they both store memory in blocks..what other difference do you actually want...maybe i think i am not getting your question..if this is not your answer..please specify your question..
@nirgandhi97884 жыл бұрын
Well if you want a bit of detail then listen......Byte of memory is allocated by malloc, whereas block of memory is allocated by calloc. malloc takes a single argument, the size of memory, where as calloc takes two parameters, the number of variables to allocate memory and size of bytes of a single variable. Memory initialization is not performed by malloc, whereas memory is initialized by calloc. malloc(s) returns a pointer with enough storage with s bytes, where as calloc(n,s) returns a pointer with enough contiguous storage each with s bytes.
@AbhishekMishra-mu2yn4 жыл бұрын
@@nirgandhi9788 ya that's i want..
@phulgandhi60294 жыл бұрын
This is amazing for the students who can't learn in English... Great job👌