I've a big doubt about when to really use heap memory. I'm studying C language and I know what memory allocation means but I didn't understand why we should use it. Yes I know that if I want to allocate an integer in the memory heap I've to use malloc function and then I've to free it to avoid memory leak but, again, why do some programmers need to allocate variables in heap memory instead of stack memory ? Sorry for my bad English, I'm trying to improve it. Thanks!
I thinks that memory heap is used when the memory stack is almost full or totally full but I'm very not sure about it.