Would like to better understand memory when it comes to programming. Variables can be assigned values within the program, however the use of pointers makes reference to a memory block instead of the actual variable? Are there different types of memory to consider when programming? What does "stack" mean? Any feedback would be appreciated.
>> Are there different types of memory to consider when programming? <<
Well, yes and no. C is considered the "High-level ASM". Of course there are "types" of memory, but C doesn't specify the types. For instance, to set aside memory, you declare a variable/pointer.
There is a keyword you can use, though. The "register" keyword checks the CPU and puts the var in the register (memory of the chip) so it is quicker accessed.
something about register!
this keyword suggest the cpu to put it in the register - but if it doesn't fit in there - it isn't forced to overwrite data in the register
every C program has 4 memory types!
stack, heap, global variable and code!
stack is a LIFO memory - Last In First Out
it is a very fast memory so you should use it for count variables in loops (every local variable is pushed on the stack or register)