473,396 Members | 2,037 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 software developers and data experts.

addresses

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
Feb 9 '08 #1
13 1445
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.
Feb 9 '08 #2
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
Feb 9 '08 #3
On Feb 8, 7:37*pm, "Bill Cunningham" <nos...@nspam.comwrote:
* * 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.

Feb 9 '08 #4
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
Feb 9 '08 #5
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
Feb 9 '08 #6
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.
Feb 9 '08 #7
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?

Feb 9 '08 #8

"santosh" <sa*********@gmail.comwrote in message
news:fo**********@registered.motzarella.org...
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?
I see what you're doing here. But I don't think it's what I'm looking
for.
Feb 9 '08 #9

"Ian Collins" <ia******@hotmail.comwrote in message
news:61**************@mid.individual.net...
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.
It looks that way.
Feb 9 '08 #10
One any virtual memory operating system, obtaining a physical address
from a virtual address is beyond the scope of standard C.
Ok all I need to know.

Bill
Feb 9 '08 #11
On Feb 9, 5:24*pm, "Bill Cunningham" <nos...@nspam.comwrote:
One any virtual memory operating system, obtaining a physical address
from a virtual address is beyond the scope of standard C.

* * Ok all I need to know.
I doubt the physical address would be very useful to you. For one
thing, the physical memory of your task may not be contiguous. And I
think it's likely to keep changing anyway.
--
Bart
Feb 9 '08 #12
Randy Howard wrote:
On Sat, 9 Feb 2008 10:58:58 -0600, Joe Wright wrote
(in article <bP******************************@comcast.com>):
>I am convinced that Bill is not a troll and is using C and Usenet as
part of his therapy.

It could also be that he has discovered that relying on political
correctness to override common sense is a proven tactic.
Possibly. But the nature of his questions and answers doesn't seem to be
trollish to me. He rarely challenges accepted beliefs for the sake of
it, and generally stays in the debate.

--
Mark McIntyre

CLC FAQ <http://c-faq.com/>
CLC readme: <http://www.ungerhu.com/jxh/clc.welcome.txt>
Feb 10 '08 #13
On Feb 9, 1:24*pm, "Serve Laurijssen" <n...@hao.comwrote:
Yeah Billy is cool :))
A big smile comes on my face when I see a thread made by Bill. Thanks! <3
Billy ``back issues'' are funny. Just don't get sucked in, that's all.

Check out message ID <q0*****************@fe06.lga>

http://groups.google.ca/group/alt.re...d380212a7dd21b
Feb 10 '08 #14

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

10
by: dave | last post by:
Hello, I'm creating a site that has several contact email addresses. These are vlid addresses, i'm wondering if i can use php to alter these addresses so that spam harvesters can't get them, yet a...
2
by: Hoang | last post by:
anyone know of an algorithm to filter out real email addresses as opposed to computer generated email addresses? I have been going through past email archives in order to find friends email...
17
by: Andrew McLean | last post by:
I have a problem that is suspect isn't unusual and I'm looking to see if there is any code available to help. I've Googled without success. Basically, I have two databases containing lists of...
3
by: Grytpype-Thynne | last post by:
Can anyone point me in the direction of a cross browser way of displaying two addresses side by side after some preliminary text? I have tried a containing box and floating two further boxes...
2
by: Not Me | last post by:
Hi, I've been having this problem for a while now and seem to be getting closer to a solution but it's still not perfect. I have a table of addresses, people (refno's) may have more than one...
6
by: DebbieG | last post by:
I am creating a database for a small department in a university. Each student in their database can have 2 mailing addresses. They wanted mailing labels pulling just the 1st address. No problem....
2
by: (Pete Cresswell) | last post by:
For better or worse, I have chosen to implement mailing addresses in a particular application as a separate table. One Person ==> Many Addresses. It is a database for managing school reunions...
11
by: Paul Fi | last post by:
How can i determine IP Address of my machine at runtime without providing any information like HostName? *** Sent via Developersdex http://www.developersdex.com *** Don't just participate in...
1
by: Lyle Fairfield | last post by:
Option Explicit ' requires VBScript to be installed ' (maybe don't give this to your sugnificant other as ' it gets deleted addresses as well as current) ' obvious fixups needed '1. how get...
4
by: =?Utf-8?B?U2VyZ2Vp?= | last post by:
Dear staff Can I get your assistance with \3GB (LARGEADDRESSAWARE) switch in mixed mode process built by VS 2008, please? I have a mixed mode application: C# GUI calling native C++ DLL through...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.