in Programming in C retagged by
1,002 views
2 votes
2 votes

How will you free the allocated memory?

  1. remove(var-name)
  2. free(var-name)
  3. delete(var-name)
  4. dalloc(var-name)
in Programming in C retagged by
by
1.0k views

4 Answers

4 votes
4 votes

Option B:free(var-name)

Dynamically allocated memory created with either calloc() or malloc() doesn't get freed on their own. You must explicitly use free() to release the space.
Syntax of free:
free(ptr);  This statement frees the space allocated in the memory pointed by ptr.

1 vote
1 vote
Option b:- free( file?)
1 vote
1 vote
option B

free(ptr) is sytnax to free the dynamic memory allocated in the heap
1 vote
1 vote

correct ans : B 

  1. free(var-name)
by
Answer:

Related questions