what will happen if you free a pointer twice after
allocating memory dynamically ?

Answers were Sorted based on User's Feedback



what will happen if you free a pointer twice after allocating memory dynamically ?..

Answer / zan

segmentation fault

Is This Answer Correct ?    19 Yes 10 No

what will happen if you free a pointer twice after allocating memory dynamically ?..

Answer / manoj

Nothing will happen. program will run fine.

Is This Answer Correct ?    6 Yes 3 No

what will happen if you free a pointer twice after allocating memory dynamically ?..

Answer / karnik ankit

segmentation fault will be created

Is This Answer Correct ?    4 Yes 9 No

Post New Answer

More C Interview Questions

Why use int main instead of void main?

0 Answers  


How to avoid structure padding in C?

8 Answers   Tech Mahindra,


what are the compilation steps? ( i want inside the compiler )

2 Answers  


the question is that what you have been doing all these periods (one year gap)

0 Answers   HCL,


Which of the following is not an infinite loop ? a.while(1){ .... } b.for(;;){ ... } c.x=0; do{ /*x unaltered within theloop*/ ... }while(x==0); d.# define TRUE 0 ... while(TRUE){ .... }

7 Answers   TCS,






what is calloc and malloc?

2 Answers  


What are the disadvantages of external storage class?

0 Answers  


write a program to check whether a given integer is a strong number or not? [Hint: 145=1!+4!+5! =1+24+120 =145]

7 Answers  


#include<stdio.h> #include<conio.h> void main() {clrscr(); char another='y'; int num; for(;another=='y';) { printf("Enter a number"); scanf("%d",&num); printf("squre of %d is %d",num,num*num); printf("\nwant to enter another number y/n"); scanf("%c",&another); } getch(); } the above code runs only one time.on entering 'y' the screen disappeares.what can i do?

3 Answers  


What is the method to save data in stack data structure type?

0 Answers  


One of the Institutes contains 5 student groups. Every group contains 4 students. Institute wants to store student group’s details in array. Group should contain group member’s details (name and registration number and age), project name, and mark of the group.

0 Answers  


without a terminator how can we print a message in a printf () function.

7 Answers   NIIT,


Categories