dereferencing far pointer in turboc

V

vishal

Hi,
I have a large memory allocated in my program and was trying to print
the values read (byte by byte) since the pointer in turboc is 2 bytes,
I used a char far pointer to the calculted address and dereferenced
it. But some how the value equivalent to deferenced value of the char
pointer instead of char far pointer.
E.g
val=*((char far *)calculated_address);
is equivalent to
val=*((char *)calculated_address);
for addresses which require more than 2 bytes.
So my question is how to dereference addresses more than 2 bytes?
I am stuck with turboc, please don't suggest changing to different
compiler, it is not a option at all.
Thanks
vishal
 
J

Joona I Palaste

vishal said:
Hi,
I have a large memory allocated in my program and was trying to print
the values read (byte by byte) since the pointer in turboc is 2 bytes,
I used a char far pointer to the calculted address and dereferenced
it. But some how the value equivalent to deferenced value of the char
pointer instead of char far pointer.

Far pointers are not a C language concept. Please ask in a newsgroup
where Turbo C is topical.
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,755
Messages
2,569,535
Members
45,007
Latest member
obedient dusk

Latest Threads

Top