Thread: Memory Acccess

  1. #1
    Registered User
    Join Date
    Nov 2007
    Posts
    12

    Memory Acccess

    Hi,

    How to access memory without using pointers?
    Last edited by Salem; 11-22-2007 at 08:24 AM. Reason: Remove horrid formatting

  2. #2
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    What do you ACTUALLY want to do - this question is like the guy with a punctured car tyre asking "How do I loosen a wheel-nut?"

    You are obviously wanting to do something "more" than accessing memory. Describe a bigger picture, and we can probably help.

    What is the reason you want to "access memory without using a pointer", you alergic to pointers, or some such?

    Essentially, most memory access happens trough a pointer in C, but it depends a little on the scenario.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  3. #3
    Registered User
    Join Date
    Nov 2007
    Posts
    12

    Smile

    I dont think its a vague question.

    Without the knowledge of pointers i would have never asked this question.

    What i want to do is to access some memory location without using pointers and put some value at that location. You can print the value or can do whatever with that value.....


    If you still feel its an irrelavent question i dont have further explanation to get answer from you

  4. #4
    Registered User
    Join Date
    Nov 2007
    Posts
    12
    You said it depends a little on the scenario.. If you have come accross such can you explain me?

  5. #5
    Kernel hacker
    Join Date
    Jul 2007
    Location
    Farncombe, Surrey, England
    Posts
    15,677
    If you don't want to put a bunch of restrictions on what memory you want to modify, then a pointer is the only way to modify memory arbitrarily - or you could of course write some assembler code to access the memory - but that's only avoiding a pointer in the same way a drug-dealer escapes a life-sentence with a clever lawyer: on a technicality. You are still using a pointer in this case, but not a C pointer.

    --
    Mats
    Compilers can produce warnings - make the compiler programmers happy: Use them!
    Please don't PM me for help - and no, I don't do help over instant messengers.

  6. #6
    and the hat of int overfl Salem's Avatar
    Join Date
    Aug 2001
    Location
    The edge of the known universe
    Posts
    39,662
    Is this a quiz question ?

    There are some answers, which can be used in some circumstances, but it isn't pretty.
    If you dance barefoot on the broken glass of undefined behaviour, you've got to expect the occasional cut.
    If at first you don't succeed, try writing your phone number on the exam paper.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. available memory from task manager
    By George2 in forum Tech Board
    Replies: 10
    Last Post: 01-18-2008, 02:32 AM
  2. Replies: 4
    Last Post: 01-13-2008, 02:14 AM
  3. Question regarding Memory Leak
    By clegs in forum C++ Programming
    Replies: 29
    Last Post: 12-07-2007, 01:57 AM
  4. Memory problem with Borland C 3.1
    By AZ1699 in forum C Programming
    Replies: 16
    Last Post: 11-16-2007, 11:22 AM
  5. Shared Memory - shmget questions
    By hendler in forum C Programming
    Replies: 1
    Last Post: 11-29-2005, 02:15 AM