Compilation time.
variable is a name that allocates the memory space where you store some data Hardly. Names do not allocate memory space *sigh*
char* new_string; // could be any type new_string = (char*) malloc (5120); // allocate memory - typecast is necessary if (new_string == NULL) ... memory exception ... ... use the data ... free (new_string); // release memory when done
New and Delete are the memory management operators in c++,like c language we use malloc() and calloc() functions to allocate memory and free() functiong to release the memory similarily we use new to allocate memory in C++ and Delete to release the allocated memory....
The C++ new uses malloc internally to allocate memory and the C++ delete uses free internally to revoke memory. However, they are not interchangeable and so memory allocated with new MUST be revoked with delete. If you mix them up, you will have a memory leak! Haya.
None of the data types available in C assigns valur to the variable. Initially all the variables have a garbage value. But when we use calloc() to allocate memory dynamically only then it assigns NULL to the memory block assigned.
There is no memory management operator in C++ -- it is an unmanaged language. You use the C++ new operator to allocate memory, and use the C++ delete operator to release previously allocated memory.
dynamic memory allocation is that type of memory which create to allocate the memory on running time or at compile time by the function of malloc , calloc , realloc and free. dynamic memory allocation is give the best utilization of memory which gives the sufficient use of memory.
Static data is data that does not change from program load to program exit. Static data member do not apply for c. In c++, a static data member is one that is common for all instances of that class.
calloc operator,malloc operator
Static memory allocation occurs at compile time where as dynamic memory allocation occurs at run time.
your mom your mom
Dynamic memory can be declared at run-time using the new and delete operators (or malloc and free in C), while static memory must be declared at compile-time.