This discussion has been locked.
You can no longer post new replies to this discussion. If you have a question you can start a new discussion

pointer to code memory

hello every one

i am trying to create a pointer to two dimensional character array located in code space of 8051

i am getting a warning of c182:pointer to different objects

my code is like this

unsigned char code table[120][5]={some values}//array daclaration

unsigned char code **ptr;//pointer to code memory

ptr = table;//trying to access this way

can any one tell what is the mistake in it

thanks®ards
ganesh

Parents
  • unsigned char code **ptr;//pointer to code memory
    

    Did you copy&paste this from your code ?

    If yes, then it's not a pointer to code memory. It's a pointer to a pointer. However, I'm not quite sure if it is a pointer a generic pointer in code memory, or a pointer in the default memory space to a pointer to code memory. Maybe some of the experts could clear this up.

Reply
  • unsigned char code **ptr;//pointer to code memory
    

    Did you copy&paste this from your code ?

    If yes, then it's not a pointer to code memory. It's a pointer to a pointer. However, I'm not quite sure if it is a pointer a generic pointer in code memory, or a pointer in the default memory space to a pointer to code memory. Maybe some of the experts could clear this up.

Children