answersLogoWhite

0

Address of the allocated area, or NULL.

User Avatar

Wiki User

15y ago

What else can I help you with?

Related Questions

What is the operator is used to allocate the memory in c plus plus?

calloc operator,malloc operator


Which Program that will run in C but not in C plus plus?

void main() { int *x = malloc(sizeof(int) * 10); }


Comparison of C' malloc and free functions with c new and delete operators?

Hi, The difference between new and malloc: 1.The New is a operator however malloc is a function 2.New returns the object type and there is no typecasting required. In malloc type casting should be done as it returns a void*. 3. The new operator can be overloaded however there is no over loading in C and hence Malloc can not be overloaded. 4. Operater New asks for the number of objects to be allocated however in malloc it will ask you for the number of bytes to be allocated. 5. The New operater will return you a exception of memory is not available however in malloc it will return u a NULL. 6. New is a concept for dynamically allocation in OOPS(C++) however malloc is used in C. The difference between the delete and free is as follows: 1. delete is a operator and can be overloaded however free is a function and can not be overloaded. With Regards, Shashiraja Shastry


What is really meant by malloc and where you will use this malloc?

malloc is a function of the standard c library (stdlib) and it is abbreviation for memory allocate. What this function does is allocates memory in the RAM of computer to store variable data in it. You will use it whenever you need a place to store you temporary data such as an array or structure. To use malloc all you have to do is call malloc and tell it the size of the memory you want. It will then return a pointer to that memory. persumabely if it fails it returns NULL.


What if happen when you allocate memory by using malloc or calloc when the momory is not available contigiously?

malloc/calloc/realloc will return NULL


Fill in blanks in c plus plus?

a functon that doesn't return anything has return type


True or False A C plus plus class constructor cannot return a function value?

True - A C++ constructor cannot return a value.


Max memory allocated by malloc in c?

Memory is allocated by malloc from the heap.... so max mem = size of heap that is free...


How you use malloc function in c?

void* malloc (size_t bytes); This means that malloc takes an argument which is the size of memory to allocate and returns a pointer to that memory which has been allocated. If the return value is NULL, then the request could not be satisfied. Each call to malloc must be balanced with a corresponding call to free, to release the memory. int pa = NULL; pa = (int*) malloc (sizeof(int) * 1000); /* allocate 1000 ints */ if (pa == NULL) throw exception... ... use pa free (pa); pa = NULL;


Memory allocation in c plus plus?

Although C++ inherits malloc/calloc, realloc and free from C, programmers are encouraged to use the object-oriented operators, new and delete instead. Not only are they much easier to use, they can also be used with primitive data types.


C plus plus program using function min that take three parameters of type int and returns the minimum of the three?

int min (int a, int b, int c) {if (a


What is the difference between malloc and new in terms of throwing exceptions?

malloc will return a 0 if memory is unable to be allocated. new on the other hand will either throw an exception or also return 0, depending on the compiler and the compiler settings.