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 |
write a program to convert a expression in polish notation (postfix) to inline (normal) something like make 723+* (2+3) x 7 (not sure) just check out its mainly printing expression in postfix form to infix
where are auto variables stored? What are the characteristics of an auto variable?
Write a program of prime number using recursion.
What will be the outcome of the following conditional statement if the value of variable s is 10?
5 Write an Algorithm to find the maximum and minimum items in a set of ‘n’ element.
Write a C program to print 1 2 3 ... 100 without using loops?
main() { int i = 10; printf(" %d %d %d ", ++i, i++, ++i); }
Describe for loop and write a c program to sum the series X + x2/2! + x3 /3! + …….. up to fifteen terms.
5) Write a program that takes a 3 digit number n and finds out whether the number 2^n + 1 is prime, or if it is not prime find out its factors.without using big int and exponential function
Explain how can you tell whether two strings are the same?
How to swap two values using a single variable ? condition: Not to use Array and Pointer ?
Toggle nth bit in a given integer - num