pointers

How do force a pointer to take a certain number as it's address ? for example if I want a pointer like: byte *segvga to have the value of: 0xa000:0x0000 or 0xa0000.

Comments

  • : How do force a pointer to take a certain number as it's address ? for example if I want a pointer like: byte *segvga to have the value of: 0xa000:0x0000 or 0xa0000.
    :
    :

    If you care about portability you don't, but you can do it as follows...

    (assuming sizeof(pointer)==sizeof(long) (i.e. use a far pointer in DOS))

    char *specific_address=(char *)0xA0000000L;

    "We can't do nothing and think someone else will make it right."
    -Kyoto Now, Bad Religion

  • Thanks man, that's exactly what I did but I forgot to check that the pointers where 32bit. I'm so used to programming djgpp in protected mode that it seems obvious. Thanks again.
Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Categories