CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 3 of 3
  1. #1
    Join Date
    Dec 2007
    Location
    France
    Posts
    329

    Memory layout help

    After reading several books and tutorials on C++ its still not clear to me
    how the memory numbered.

    Is it like the addresses goes from 0x000000 until the available amount of memory and then the programs assigned somewhere between them?

    Or is it every program loaded into memory starts with 0x000000 and then
    the processor knows some way where to access them?

    Im asking this also because if i compile the same program again only with another name, i mean that i make a copy of it, it will give the same addresses
    for the same variables.

  2. #2
    Join Date
    Mar 2002
    Location
    St. Petersburg, Florida, USA
    Posts
    12,125

    Re: Memory layout help

    You are confusing Logical and Physical addresses. A program is based on Logcal addresses (which will typically be duplicated between programs). The hardware works on Physical addresses which are usually totally invisible to the program (and are potentially different each time the program is loaded into memory.
    TheCPUWizard is a registered trademark, all rights reserved. (If this post was helpful, please RATE it!)
    2008, 2009,2010
    In theory, there is no difference between theory and practice; in practice there is.

    * Join the fight, refuse to respond to posts that contain code outside of [code] ... [/code] tags. See here for instructions
    * How NOT to post a question here
    * Of course you read this carefully before you posted
    * Need homework help? Read this first

  3. #3
    Join Date
    Dec 2007
    Location
    France
    Posts
    329

    Re: Memory layout help

    Ah, ok, thats why i didnt understand it, i didnt know there were two kind of addresses.
    So then every program starts with 0x000000.

    Thanks for clearing this up to me!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  





Click Here to Expand Forum to Full Width

Featured