+ 2

why "how computer memory works " is an important aspect in c??

how does c deals with the computer memory ??

15th Oct 2018, 11:03 AM
Shashwat Jha
Shashwat Jha - avatar
1 Antwort
+ 5
In C you have to do memory management yourself with `malloc` and `free`. So if you want to process a 10 kilobyte textfile, you have to malloc those 10 kilobytes yourself, and then give them back to the operating system when you don't need the memory anymore. Other programming languages usually do this for you. Also note the datatypes in C: char, short, int, long, float, double. They are all numbers. Every time you are programming C you are just shuffling numbers in memory. C is like "the smallest possible programming language" (that is also useful). It gives you functions and loops and structs but that's it. All the memory management and lots of other things you have to do yourself.
15th Oct 2018, 11:20 AM
Schindlabua
Schindlabua - avatar