CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Threaded View

  1. #2
    Join Date
    May 2009
    Posts
    2,413

    Re: What is meant by "Compiler allocates memory for an array"

    Quote Originally Posted by AwArEnEsS View Post
    But when I run the executable file and if that memory address(189) is not free,what happens?
    Most addresses in a program are relative to something (the most common exception is addresses to hardware units which are at fixed locations).

    In your example 189 would not be an absolute address but rather an offset from some base register. This base register would be set to a defined address when the program is started, say the address of the start position of the program. In this way it doesn't matter where the program is loaded into memory. It's relocatable.
    Last edited by nuzzle; October 31st, 2012 at 12:16 AM.

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