Ok, I am not exactly new to programming. While Ive done alot of relatively few programs (you could say ive spent the last 8 years learning the basics of basic, c, cobol, c++, java, html, cold fusion, and sql) but nothing realy advanced beyond the point of simple calculator programs and pure text data input/output. (I might say ive done a bit further than that with cold fusion/sql stuff. e.g.: linked tree node structures to handle database lists for an outline program, but almost not real programming was involved).
Well, im starting to get more serious with my programming, so ive been looking over pointers and arrays last few days and I came to a question I couldn't seem to answer with the couple c books ive got.
Whereas a variable is basicaly an address with something in it. lvalue being the memory address in which the rvalue is, rvalue being the actual "data". Isnt there also something more? Like a third value which is the name of the variable? So in reality we have two slots in memory being used with the name and the data? How much actual space in memory is being used if say the type is an int?
A pointer then would be a space in memory that holds its name and a memory address. That address potentialy pointing to "data". How much actual space in memory is being used if the type is an int? (not including the space in memory the address would be pointing to)
My third question is with arrays. Im not quite sure how to explain how I think arrays work (in memory wise) but I am still insterested how much total memory would be taken by an int array; If anyone can explain it better than me (me having not explained at all), please do so.
I may not have gotten it right. While I can use arrays, pointers, and obviously variables, I want to know how exactly they work and how much real memory they take not just the "2 bytes" an int variable seems to imply.