Memory address?

This is a discussion on Memory address? within the C++ Programming forums, part of the General Programming Boards category; I have noticed that when I try to print a memory address to the screen I just get jibberish. But ...

  1. #1
    _ Munkey01's Avatar
    Join Date
    Dec 2002
    Posts
    280

    Memory address?

    I have noticed that when I try to print a memory address to the screen I just get jibberish. But when ever I write the address to a text file it seems to be a valid address. Why does it not show up on the screen but yet it shows in the file?

  2. #2
    I lurk
    Join Date
    Aug 2002
    Posts
    1,361
    What does it show up as on screen? Like 0x0043FFD5?

  3. #3
    End Of Line Hammer's Avatar
    Join Date
    Apr 2002
    Posts
    6,231
    How are you printing it?
    Code:
    #include <iostream>
    
    using std::cout;
    using std::endl;
    
    int main(void)
    {
      int i;
      int *p = &i;
      cout <<"p is pointing to " <<p <<endl;  
      p++;
      cout <<"p is now pointing to " <<p <<endl;  
      return(0);
    }
    When all else fails, read the instructions.
    If you're posting code, use code tags: [code] /* insert code here */ [/code]

  4. #4
    _ Munkey01's Avatar
    Join Date
    Dec 2002
    Posts
    280
    Thanks hammer.

  5. #5
    Registered User rmullen3's Avatar
    Join Date
    Nov 2001
    Posts
    330

    ~

    ... ?
    "He who makes a beast of himself, gets rid of the pain of being a man." Dr. Johnson

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. tools for finding memory leaks
    By stanlvw in forum C++ Programming
    Replies: 4
    Last Post: 04-03-2009, 12:41 PM
  2. Pointer to specific memory address
    By elnerdo in forum C++ Programming
    Replies: 10
    Last Post: 05-19-2006, 08:35 AM
  3. Memory Address
    By Stack Overflow in forum C Programming
    Replies: 5
    Last Post: 05-25-2004, 12:43 PM
  4. how to get memory address applied in other program?
    By wu7up in forum C Programming
    Replies: 1
    Last Post: 03-01-2003, 01:44 AM
  5. Manipulating the Windows Clipboard
    By Johno in forum Windows Programming
    Replies: 2
    Last Post: 10-01-2002, 10:37 AM

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