Issue with using realloc – not getting expected amount of memory
I have to write a program that is able to take in a file of grades, read them, and then provide some options to be able to edit that file. I decided to write it in C (for the challenge, and to learn more about C). I have a function that receives a pointer, and then opens a file and loads the characters from that file, into the memory provided by that pointer.
Issue with using realloc – not getting expected amount of memory
I have to write a program that is able to take in a file of grades, read them, and then provide some options to be able to edit that file. I decided to write it in C (for the challenge, and to learn more about C). I have a function that receives a pointer, and then opens a file and loads the characters from that file, into the memory provided by that pointer.
Issue with using realloc in C – not getting expected amount of memory
First time question, so please be kind 🙂
Realloc doesn’t shrink memory? (C)
I have this simple code snippet as seen below: