ALLInterview.com :: Home Page KalAajKal.com
 Advertise your Business Here     
Browse  |   Placement Papers  |   Company  |   Code Snippets  |   Certifications  |   Visa Questions
Post Question  |   Post Answer  |   My Panel  |   Search  |   Articles  |   Topics  |   ERRORS new
   Refer this Site  Refer This Site to Your Friends  Site Map  Bookmark this Site  Set it as your HomePage  Contact Us     Login  |  Sign Up                      
tip   To Refer this Site to Your Friends   Click Here
Google
 
Categories  >>  Software  >>  Programming Languages  >>  C
 
 


 

 
 C interview questions  C Interview Questions
 C++ interview questions  C++ Interview Questions
 VC++ interview questions  VC++ Interview Questions
 Delphi interview questions  Delphi Interview Questions
 Programming Languages AllOther interview questions  Programming Languages AllOther Interview Questions
Question
what's the return value of malloc()
 Question Submitted By :: Aruncit
I also faced this Question!!     Rank Answer Posted By  
 
  Re: what's the return value of malloc()
Answer
# 1
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 ?    5 Yes 0 No
Vrushali
 
  Re: what's the return value of malloc()
Answer
# 2
garbage
but calloc returns zero
 
Is This Answer Correct ?    1 Yes 4 No
Himanshu
 
 
 
  Re: what's the return value of malloc()
Answer
# 3
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 ?    6 Yes 0 No
Ravi A Joshi
 
  Re: what's the return value of malloc()
Answer
# 4
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 ?    2 Yes 0 No
Shashidhar Murthy
 
  Re: what's the return value of malloc()
Answer
# 5
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 0 No
Sourisengupta
 
  Re: what's the return value of malloc()
Answer
# 6
malloc is a pointer  it is used to allocate memory
 
Is This Answer Correct ?    0 Yes 0 No
Tamil
 
  Re: what's the return value of malloc()
Answer
# 7
void
 
Is This Answer Correct ?    0 Yes 1 No
Ruchi
 
  Re: what's the return value of malloc()
Answer
# 8
malloc returns void pointer to allocated memory location.
it is also called generic pointer
 
Is This Answer Correct ?    1 Yes 0 No
Monu Verma
 

 
 
 
Other C Interview Questions
 
  Question Asked @ Answers
 
How can I prevent other programmers from violating encapsulation by seeing the private parts of my class?  1
Write a C program that reads a series of strings and prints only those ending in "ed"  2
what information does the header files contain? BSNL5
Write a program to find the given number is odd or even without using any loops(if,for,do,while)  2
what is the diff between the printf and sprintf functions?? and what is the syntax for this two functions ??  4
What is the memory allocated by the following definition ? int (*x)[10]; ADITI3
how memory store byte Huawei3
2)#include<iostream.h> main() { printf("Hello World"); } the program prints Hello World without changing main() the o/p should be intialisation Hello World Desruct the changes should be a)iostream operator<<(iostream os, char*s) os<<'intialisation'<<(Hello World)<<Destruct b) c) d)none of the above Siemens4
main() { int x=5; printf("%d %d %d\n",x,x<<2,x>>2); } CitiGroup7
macros and function are related in what aspect? a)recursion b)varying no of arguments c)hypochecking d)type declaration HCL8
Program to find the absolute value of given integer using Conditional Operators N-Tech2
Why the use of alloca() is discouraged? Oracle2
How to convert a binary number to Hexa decimal number?? (Note:Do not convert it into binary and to Hexadecimal) Subex1
how to find the binary of a number? Infosys5
What is true about the following C Functions a.Need not return any value b.Should always return an integer c.Should always return a float d.Should always return more than one value. TCS7
helllo sir , what is the main use of the pointer ,array ,and the structure with the example of a programe  2
Who is invented by c? Infosys14
What is structure packing ? HP1
1.find the second maximum in an array? 2.how do you create hash table in c? 3.what is hash collision Qualcomm6
write a program to print sum of each row of a 2D array.  2
 
For more C Interview Questions Click Here 
 
 
 
 
 
   
Copyright Policy  |  Terms of Service  |  Help  |  Site Map 1  |  Articles  |  Site Map  |   Site Map  |  Contact Us interview questions urls   External Links 
   
Copyright © 2007  ALLInterview.com.  All Rights Reserved.

ALLInterview.com   ::  Forum9.com   ::  KalAajKal.com