What are these numbers?

This is a discussion on What are these numbers? within the C++ Programming forums, part of the General Programming Boards category; I have the following function, when it is called, it printed out two sets of numbers 0x3d2468 and 0x3d2590. What ...

  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,812
    Those would be the memory addresses of P and Q.
    Woop?

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

    See http://en.wikipedia.org/wiki/Hexadecimal
    The programmer’s wife tells him: “Run to the store and pick up a loaf of bread. If they have eggs, get a dozen.”
    The programmer comes home with 12 loaves of bread.


    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
    CSharpener vart's Avatar
    Join Date
    Oct 2006
    Location
    Rishon LeZion, Israel
    Posts
    6,484
    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
    The first 90% of a project takes 90% of the time,
    the last 10% takes the other 90% of the time.

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, 07:28 AM
  2. Help with Rational Numbers (C++)
    By cloudjc in forum C++ Programming
    Replies: 3
    Last Post: 04-28-2008, 05:03 PM
  3. Logical errors with seach function
    By Taka in forum C Programming
    Replies: 4
    Last Post: 09-18-2006, 06: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

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