When you call malloc() to allocate memory for a local
pointer, do you have to explicitly free() it?

Answers were Sorted based on User's Feedback



When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?..

Answer / shruti

yup.. we have to explicitly free it..
otherwise it results in "dangling pointer"..

Is This Answer Correct ?    20 Yes 0 No

When you call malloc() to allocate memory for a local pointer, do you have to explicitly free() it?..

Answer / guest

Yes you have to.

Is This Answer Correct ?    13 Yes 1 No

Post New Answer

More C Interview Questions

How can I convert integers to binary or hexadecimal?

2 Answers  


Does sprintf put null character?

0 Answers  


What is the symbol indicated the c-preprocessor?

0 Answers  


main() { int a=4,b=2; a=b<<a + b>>2; printf("%d", a); }

11 Answers   HCL, Vector, Vector India, Vector Solutions, Wipro,


What is the purpose of main() function?

0 Answers  






What are the types of c language?

0 Answers  


out put of printf(“%d”,printf(ram));

5 Answers  


What is pointer & why it is used?

0 Answers  


how i m write c program 1.check prime number 2.prime number series

1 Answers  


what type of errors are checked during compilation

3 Answers  


Is a house a mass structure?

0 Answers  


How can I make sure that my program is the only one accessing a file?

0 Answers  


Categories