physical address or logical ??

This is a discussion on physical address or logical ?? within the C++ Programming forums, part of the General Programming Boards category; Code: #include <iostream.h> void main(){ int a = 1; cout<< &a; } is the address output the actual physical memory ...

  1. #1
    Registered User
    Join Date
    Oct 2005
    Location
    Hyderabad, India
    Posts
    33

    physical address or logical ??

    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.

  2. #2
    Registered User
    Join Date
    Sep 2004
    Posts
    197
    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.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. What does this do (Windows API)?
    By EVOEx in forum Windows Programming
    Replies: 4
    Last Post: 12-19-2008, 09:48 AM
  2. I thought pointers were pointers...
    By keira in forum C Programming
    Replies: 19
    Last Post: 08-15-2007, 11:48 PM
  3. DX - CreateDevice - D3DERR_INVALIDCALL
    By Tonto in forum Game Programming
    Replies: 3
    Last Post: 12-01-2006, 06:17 PM
  4. pointers
    By InvariantLoop in forum C Programming
    Replies: 13
    Last Post: 02-04-2005, 08:32 AM
  5. Im so lost at . .
    By hermit in forum C Programming
    Replies: 18
    Last Post: 05-15-2002, 01:26 AM

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21