is the address output the actual physical memory address of the variable or some logical address.Code:#include <iostream.h> void main(){ int a = 1; cout<< &a; }
is the address output the actual physical memory address of the variable or some logical address.Code:#include <iostream.h> void main(){ int a = 1; cout<< &a; }
Umm, your not giving much information. What OS, Hardware, compiler?
If its Linux (on x86,x86-64), Windows, or Mac OS X, its most likely a logical address, as the kernel maps the logical addresses to physical ones for those operating systems I think.
Also
int main, not void main, main returns an int as part of the standard, and I think your book, teacher, tutorial is outdated, and your compiler probably as well, since you are supposed to use iostream, not iostream.h
If any part of my post is incorrect, please correct me.
This post is not guarantied to be correct, and is not to be taken as a matter of fact, but of opinion or a guess, unless otherwise noted.