what's the return value of malloc()
Answers were Sorted based on User's Feedback
Answer / vrushali
If there is memory avaliablity in the system..
Then fisrt address of the memory allocated in returned.
Else NULL/Garbage value is returned.
Is This Answer Correct ? | 22 Yes | 2 No |
Answer / ravi a joshi
malloc() returns pointer to void. That is, pointer to the
first memory location of the allocated memory block. The
pointer type is unknown at this point, hence typecasting is
done later.
Is This Answer Correct ? | 17 Yes | 1 No |
Answer / monu verma
malloc returns void pointer to allocated memory location.
it is also called generic pointer
Is This Answer Correct ? | 6 Yes | 0 No |
Answer / shashidhar murthy
malloc returns a pointer to the allocated space if required
memory is found, else, a null pointer is returned and
'errno' is set to indicate the error.
Is This Answer Correct ? | 5 Yes | 0 No |
Answer / tamil
malloc is a pointer it is used to allocate memory
Is This Answer Correct ? | 0 Yes | 0 No |
Answer / 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 |
Answer / sourisengupta
malloc returns a pointer to the allocated space if required
memory is available otherwise it will return a null pointer.
Is This Answer Correct ? | 0 Yes | 1 No |
difference of two no's with out using - operator
What is pass by reference in c?
Write a program to find the given number is odd or even without using any loops(if,for,do,while)
Write any data structure program (stack implementation)
If we give two names then this displays the connection between the two people. It is nothing but flames game
Write a C/C++ program to add a user to MySQL. The user should be permitted to only "INSERT" into the given database.
cin.ignore(80, _ _);This statement a) ignores all input b) ignores the first 80 characters in the input c) ignores all input till end-of-line d) iteration
2. Write a function called hms_to_secs() that takes three int values—for hours, minutes, and seconds—as arguments, and returns the equivalent time in seconds.. Create a program that exercises this function by repeatedly obtaining a time value in hours, minutes, and seconds from the user (format 12:59:59), calling the function, and displaying the value of seconds it returns.
What is const keyword in c?
What is static and volatile in c?
Can stdout be forced to print somewhere other than the screen?
What is class and object in c?