addresses

Discussion in 'C Programming' started by Morris Dovey, Feb 9, 2008.

  1. Morris Dovey

    Morris Dovey Guest

    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
    Morris Dovey, Feb 9, 2008
    #1
    1. Advertising

  2. 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
    Bill Cunningham, Feb 9, 2008
    #2
    1. Advertising

  3. Morris Dovey

    Ian Collins Guest

    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.
    Ian Collins, Feb 9, 2008
    #3
  4. Morris Dovey

    Kaz Kylheku Guest

    On Feb 8, 7:37 pm, "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?


    When you become qualified to work with this type of information, you
    will distinguish yourself by knowing where to begin looking for it.
    Kaz Kylheku, Feb 9, 2008
    #4
  5. > 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
    Bill Cunningham, Feb 9, 2008
    #5
  6. > 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
    Bill Cunningham, Feb 9, 2008
    #6
  7. Morris Dovey

    Ian Collins Guest

    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.
    Ian Collins, Feb 9, 2008
    #7
  8. Morris Dovey

    santosh Guest

    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?
    santosh, Feb 9, 2008
    #8
  9. Morris Dovey

    santosh Guest

    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.
    santosh, Feb 9, 2008
    #9
  10. Morris Dovey

    Kaz Kylheku Guest

    On Feb 8, 7:37 pm, "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?


    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.
    Kaz Kylheku, Feb 9, 2008
    #10
  11. Morris Dovey

    Default User Guest

    Kaz Kylheku wrote:

    > On Feb 8, 7:37 pm, "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?

    >
    > 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.



    I can't tell. I do know that he ignores all advice. I'm plonking him.




    Brian
    Default User, Feb 9, 2008
    #11
  12. Kaz Kylheku wrote:
    > On Feb 8, 7:37 pm, "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?

    >
    > 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.


    Apparently he has learning difficulties.
    Mark McIntyre, Feb 9, 2008
    #12
  13. Morris Dovey

    pete Guest

    Kaz Kylheku wrote:

    > 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.


    He's a very sophisticated troll.
    He's on topic.
    He addresses the technical content of posted replies.
    But it's his complete lack of arrogance
    that fools most people into thinking that he's legitimate.
    And he's consistent about all of that too.

    --
    pete
    pete, Feb 9, 2008
    #13
  14. "santosh" <> wrote in message
    news:fojb0d$aup$...
    > 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.
    Bill Cunningham, Feb 9, 2008
    #14
  15. "Ian Collins" <> wrote in message
    news:...
    > 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.
    Bill Cunningham, Feb 9, 2008
    #15
  16. Morris Dovey

    Joe Wright Guest

    Mark McIntyre wrote:
    > Kaz Kylheku wrote:
    >> On Feb 8, 7:37 pm, "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?

    >>
    >> 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.

    >
    > Apparently he has learning difficulties.


    Yes he does. He is seriously challenged. Some time ago he explained some
    of his difficulties, mainly to do with memory.

    I am convinced that Bill is not a troll and is using C and Usenet as
    part of his therapy.

    We should help him as much as we can, and not be offended if our advice
    doesn't "take".

    --
    Joe Wright
    "If you think Health Care is expensive now, wait until it's free."
    Joe Wright, Feb 9, 2008
    #16

  17. > 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
    Bill Cunningham, Feb 9, 2008
    #17
  18. Morris Dovey

    Bart Guest

    On Feb 9, 5:24 pm, "Bill Cunningham" <> wrote:
    > > 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
    Bart, Feb 9, 2008
    #18
  19. Morris Dovey

    Randy Howard Guest

    On Sat, 9 Feb 2008 10:58:58 -0600, Joe Wright wrote
    (in article <>):

    > Mark McIntyre wrote:
    >> Kaz Kylheku wrote:
    >>> On Feb 8, 7:37 pm, "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?
    >>>
    >>> 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.

    >>
    >> Apparently he has learning difficulties.

    >
    > Yes he does. He is seriously challenged. Some time ago he explained some
    > of his difficulties, mainly to do with memory.
    >
    > I am convinced that Bill is not a troll and is using C and Usenet as
    > part of his therapy.
    >
    > We should help him as much as we can, and not be offended if our advice
    > doesn't "take".


    It could also be that he has discovered that relying on political
    correctness to override common sense is a proven tactic.



    --
    Randy Howard (2reply remove FOOBAR)
    "The power of accurate observation is called cynicism by those
    who have not got it." - George Bernard Shaw
    Randy Howard, Feb 9, 2008
    #19
  20. "pete" <> schreef in bericht
    news:...
    > Kaz Kylheku wrote:
    >
    >> 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.

    >
    > He's a very sophisticated troll.
    > He's on topic.
    > He addresses the technical content of posted replies.
    > But it's his complete lack of arrogance
    > that fools most people into thinking that he's legitimate.
    > And he's consistent about all of that too.


    Yeah Billy is cool :))
    A big smile comes on my face when I see a thread made by Bill. Thanks! <3
    Serve Laurijssen, Feb 9, 2008
    #20
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. salman sheikh

    Best way to mux addresses

    salman sheikh, Jan 30, 2004, in forum: VHDL
    Replies:
    0
    Views:
    520
    salman sheikh
    Jan 30, 2004
  2. c186282

    Maps and addresses

    c186282, Sep 9, 2003, in forum: Perl
    Replies:
    2
    Views:
    728
    c186282
    Sep 10, 2003
  3. Duke of Hazard
    Replies:
    0
    Views:
    755
    Duke of Hazard
    Jan 23, 2004
  4. Kelly
    Replies:
    1
    Views:
    413
    The Durban Towel
    Apr 28, 2004
  5. namespace1
    Replies:
    3
    Views:
    892
Loading...

Share This Page