I have a question, I'm trying to think of what happens behind the scenes when you use a native type in a programming language.
I'm going to use VB.net for an example:
Dim ourInteger as Integer
Or C++:
int variable;
That is obviously 4 bytes in memory, but the question being, is there a pointer being created that points to that Integer in memory either in the code memory or data memory for the program? So if you declare that does it end up using 8 bytes in memory, 4 for the integer, and 4 for a pointer to that integer that is assigned to the ourInteger name?
I remember way back with C++ that constants are considered pointers, and declarations are a constant so to speak aren't they? Just a bit confused about an int this doesn't seem as clear.
Can anybody clear this up for me what happens behind the scenes in memory when you do a simple declartion with just an integer, how does the program find that integer in memory when trying to use it? Is there a pointer?
I'm going to use VB.net for an example:
Dim ourInteger as Integer
Or C++:
int variable;
That is obviously 4 bytes in memory, but the question being, is there a pointer being created that points to that Integer in memory either in the code memory or data memory for the program? So if you declare that does it end up using 8 bytes in memory, 4 for the integer, and 4 for a pointer to that integer that is assigned to the ourInteger name?
I remember way back with C++ that constants are considered pointers, and declarations are a constant so to speak aren't they? Just a bit confused about an int this doesn't seem as clear.
Can anybody clear this up for me what happens behind the scenes in memory when you do a simple declartion with just an integer, how does the program find that integer in memory when trying to use it? Is there a pointer?