what's the return value of malloc()

Answer Posted / ashish

Upon successful completion with size not equal to 0, malloc() shall return a pointer to the allocated space. If size is 0, either a null pointer or a unique pointer that can be successfully passed to free() shall be returned. Otherwise, it shall return a null pointer [CX] and set errno to indicate the error

Is This Answer Correct ?    0 Yes 0 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

In C programming, what command or code can be used to determine if a number of odd or even?

618


What is typedef struct in c?

581


What is typedef?

664


What is a good data structure to use for storing lines of text?

590


What is substring in c?

634






How can you return multiple values from a function?

626


How macro execution is faster than function ?

660


What is the difference between NULL and NUL?

724


What does %c mean in c?

643


What are the ways to a null pointer can use in c programming language?

588


What is property type c?

599


What is a shell structure examples?

586


What is the difference between int main and void main in c?

589


How many levels deep can include files be nested?

646


if (i = 0)printf ("True"); elseprintf("False"); Under what conditions will the above print out the string "True" a) Never b) Always c) When the value of i is 0 d) all of the above

707