Is there a way to print out the lowest and highest memory address that an Operating System can address in C?
Share
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
No, this is not a feature of standard C. Whatever solution you need will need to be OS-specific.
If you have some specific OS’ in mind, you should mention them. But I’m having a hard time wondering why this would matter. It’s not required to be able to write C programs, so perhaps you could enlighten us.
Based on your comment:
Again this depends on the OS. Your address space is not necessarily the physical memory you have, it’s the totality of the locations you can address. For example, an operating system based on x86 may give every single process its own 4G address space but you have to ask the OS for “backing” memory (actual real memory to put in that address space).
And some of that address space is actually shared amongst all processes (where the OS can load one physical copy of its code for the use of all processes, for example).
You have to remember that virtual memory and physical memory are very different beasts.