Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C Programming > addresses

Reply
Thread Tools

addresses

 
 
Morris Dovey
Guest
Posts: n/a
 
      02-09-2008
Bill Cunningham wrote:
>
> Are there any functions in c like memcpy perhaps that can return the
> memory address from the address bus for an array of say char name[5] ? This
> would be 40 bits somewhere. Where in memory?


A pointer is as close as you'll get. For machines with a linear
address space, the pointer will probably be the memory address -
but for other architectures (and perhaps some virtual machines)
the pointer may very not be a unique address.

--
Morris Dovey
DeSoto Solar
DeSoto, Iowa USA
http://www.iedu.com/DeSoto
 
Reply With Quote
 
 
 
 
Bill Cunningham
Guest
Posts: n/a
 
      02-09-2008
Are there any functions in c like memcpy perhaps that can return the
memory address from the address bus for an array of say char name[5] ? This
would be 40 bits somewhere. Where in memory?

Bill


 
Reply With Quote
 
 
 
 
Ian Collins
Guest
Posts: n/a
 
      02-09-2008
Bill Cunningham wrote:
> Are there any functions in c like memcpy perhaps that can return the
> memory address from the address bus for an array of say char name[5] ? This
> would be 40 bits somewhere. Where in memory?
>

C has no such concept. The best you can do is take the address of a
variable and use that address within the context of the application.
That address may or may not map directly to a physical address.

One any virtual memory operating system, obtaining a physical address
from a virtual address is beyond the scope of standard C.

--
Ian Collins.
 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      02-09-2008
On Feb 8, 7:37*pm, "Bill Cunningham" <(E-Mail Removed)> wrote:
> * * Are there any functions in c like memcpy perhaps that can return the
> memory address from the address bus for *an array of say char name[5] ? This
> would be 40 bits somewhere. Where in memory?


When you become qualified to work with this type of information, you
will distinguish yourself by knowing where to begin looking for it.

 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      02-09-2008
> C has no such concept. The best you can do is take the address of a
> variable and use that address within the context of the application.
> That address may or may not map directly to a physical address.
>
> One any virtual memory operating system, obtaining a physical address
> from a virtual address is beyond the scope of standard C.


Perhaps what I'm thinking of is a kernel function and the kernel mapping
virtual addresses to physical.
What I'm looking for is probably a probably a return of a virtual
address in hex.

Bill


 
Reply With Quote
 
Bill Cunningham
Guest
Posts: n/a
 
      02-09-2008
> A pointer is as close as you'll get. For machines with a linear
> address space, the pointer will probably be the memory address -
> but for other architectures (and perhaps some virtual machines)
> the pointer may very not be a unique address.
>

How would you use a pointer?

Bill


 
Reply With Quote
 
Ian Collins
Guest
Posts: n/a
 
      02-09-2008
Bill Cunningham wrote:
>> C has no such concept. The best you can do is take the address of a
>> variable and use that address within the context of the application.
>> That address may or may not map directly to a physical address.
>>
>> One any virtual memory operating system, obtaining a physical address
>> from a virtual address is beyond the scope of standard C.

>
> Perhaps what I'm thinking of is a kernel function and the kernel mapping
> virtual addresses to physical.


That would be very platform specific.

> What I'm looking for is probably a probably a return of a virtual
> address in hex.
>

I'm not sure you are sure what you are looking for! Why do you want to
know a physical address? Only a device driver would care. If you want
to print something in hex, use the printf %x specifier.

--
Ian Collins.
 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      02-09-2008
Bill Cunningham wrote:

>> A pointer is as close as you'll get. For machines with a linear
>> address space, the pointer will probably be the memory address -
>> but for other architectures (and perhaps some virtual machines)
>> the pointer may very not be a unique address.
>>

> How would you use a pointer?


int i, *p = &i;
*p = 5;

Why don't you go through a tutorial?

 
Reply With Quote
 
santosh
Guest
Posts: n/a
 
      02-09-2008
Bill Cunningham wrote:

>> C has no such concept. The best you can do is take the address of a
>> variable and use that address within the context of the application.
>> That address may or may not map directly to a physical address.
>>
>> One any virtual memory operating system, obtaining a physical address
>> from a virtual address is beyond the scope of standard C.

>
> Perhaps what I'm thinking of is a kernel function and the kernel
> mapping
> virtual addresses to physical.
> What I'm looking for is probably a probably a return of a virtual
> address in hex.


C has no concept of "kernel function", "kernel mapping", "virtual
address" etc.

There may or may not be a kernel present. The machine may or may not use
virtual memory. These details are implementation dependant. See the
documentation for your processor and operating system. Since you are
using Windows the online MSDN documentation will help you.

 
Reply With Quote
 
Kaz Kylheku
Guest
Posts: n/a
 
      02-09-2008
On Feb 8, 7:37*pm, "Bill Cunningham" <(E-Mail Removed)> wrote:
> * * Are there any functions in c like memcpy perhaps that can return the
> memory address from the address bus for *an array of say char name[5] ? This
> would be 40 bits somewhere. Where in memory?


This "Bill Cunningham" Usenet identity is a troll. You can tell from
this thread alone, but a quick peek at the posting history pretty much
confirms it.
 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
How to implement a firewall for Windows platform that blocks based on Mac addresses instead of IP addresses cagdas.gerede@gmail.com C Programming 1 12-07-2006 04:30 AM
Physical Addresses VS. Logical Addresses namespace1 C++ 3 11-29-2006 03:07 PM
DCHP/IP Addresses =?Utf-8?B?Um9iZXJ0SldyaWdodA==?= Wireless Networking 6 12-11-2005 04:35 AM
IP addresses changhe after every reboot =?Utf-8?B?LS0tLW5pa29zIDQwMDAtLS0t?= Wireless Networking 1 01-27-2005 01:01 AM
NEW TOOL: SMAC-CL 1.0, Console App for modifying MAC addresses kl Wireless Networking 2 07-19-2004 07:12 AM



Advertisments