Thread: What are these numbers?

  1. #1
    Registered User
    Join Date
    Apr 2007
    Posts
    42

    What are these numbers?

    I have the following function, when it is called, it printed out two sets of numbers 0x3d2468 and 0x3d2590. What are these numbers represent? What are they used for? Thanks in advance.

    Code:
    typedef int* ptrType;
    
    int somefunction()
    {
        ptrType P = new int;
        ptrType Q = new int;
        cout << P <<" " << Q <<endl;
        return 0;
    }

  2. #2
    Sweet
    Join Date
    Aug 2002
    Location
    Tucson, Arizona
    Posts
    1,820
    Those would be the memory addresses of P and Q.
    Woop?

  3. #3
    (?<!re)tired Mario F.'s Avatar
    Join Date
    May 2006
    Location
    Ireland
    Posts
    8,446
    They are integer integrals in hexadecimal format.

    See http://en.wikipedia.org/wiki/Hexadecimal
    Originally Posted by brewbuck:
    Reimplementing a large system in another language to get a 25% performance boost is nonsense. It would be cheaper to just get a computer which is 25% faster.

  4. #4
    Registered User
    Join Date
    Apr 2007
    Posts
    42
    thanks

  5. #5
    Hurry Slowly vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,788
    Those would be the memory addresses of P and Q.
    Not correct...
    They are adresses of the allocated memory stored in the P and Q...
    To print adresses of P and Q you will use &P and &Q
    All problems in computer science can be solved by another level of indirection,
    except for the problem of too many layers of indirection.
    – David J. Wheeler

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Question about random numbers
    By Kempelen in forum C Programming
    Replies: 2
    Last Post: 07-02-2008, 06:28 AM
  2. Help with Rational Numbers (C++)
    By cloudjc in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2008, 04:03 PM
  3. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 05:20 AM
  4. the definition of a mathematical "average" or "mean"
    By DavidP in forum A Brief History of Cprogramming.com
    Replies: 7
    Last Post: 12-03-2002, 11:15 AM
  5. A (complex) question on numbers
    By Unregistered in forum C++ Programming
    Replies: 8
    Last Post: 02-03-2002, 06:38 PM