+ 11
Size of a variable
when I declare a variable it takes a part from the memory which memory they mean is it Ram or ssd or what (I am too ignorant đđ)
5 Answers
+ 10
The stack is generally used to store all of the stuff you create at compile-time such as local variables, the parameters you pass in a function and more...
The heap is mainly used to store all of the stuff you create at run time, there is always a variable that points to the dynamic space and this is what we call a "pointer".
More:
https://www.quora.com/What-is-the-difference-between-the-stack-and-the-heap
+ 12
You're just a beginner, not ignorant, this is a legit question, LOL.
Basically the allocated space depends on the variable itself, it can be stored mainly in CPU registers or into the stack.
The stack is stored in computer RAM. CPU registers are way faster but limited.
Note. There's also the heap where it's stored the dynamically created space, however the variable that points to that space is always located into the stack.
+ 8
what is the defferent between stack and heap and what is the realtive between them and Ram
+ 6
thanks for helping Maz
+ 2
Java and JS =???