Lesson 21 of 23
Dynamic Memory: malloc, free
10 min 35 XP
Size run time-ൽ മാത്രം അറിയുമ്പോൾ malloc ഉപയോഗിച്ച് heap memory ചോദിക്കൂ. കഴിഞ്ഞാൽ free ഉപയോഗിച്ച് വിട്ടുകൊടുക്കൂ, അല്ലെങ്കിൽ memory leak ഉണ്ടാകും.
Example: edit me and press Run
Output Loading C (first time takes a few seconds)
Press Run to see the result here.malloc vs calloc: calloc memory പൂജ്യമാക്കുകയും ചെയ്യുന്നു; realloc അതിന്റെ size മാറ്റുന്നു. Stack vs heap പതിവായി വരുന്ന interview ചോദ്യമാണ്.