Pointers and addresses

Richard A. O'Keefe ok at goanna.cs.rmit.oz.au
Tue Oct 30 13:00:12 AEST 1990


In article <15831 at mentor.cc.purdue.edu>,
  shepherd at mentor.cc.purdue.edu (Mike Shepherd) writes:
> Is there a way to change an integer into an address location, vice versa, an
> address location into an integer?

What on earth is an address location?  Do you mean a pointer?
How about an example of what you want to do?

Bear in mind that pointers and integers are different sizes on some
machines (e.g. Primes with 32-bit integers and 48-bit pointers, PCs
with 16-bit "int" and 32-bit "far pointer") and that even on machines
where they are the same size not all integers correspond to valid
addresses (e.g. 370/XA).  You really do need to tell us what you are
trying to do before we can give you advice worth having.

> I keep getting illegal indirection & illegal pointer/integer comb errors.
> Is this possible?

If it happens, it's possible.
Why don't you show us a _small_ example of the code you're trying to
write and what goes wrong with it, so that we can help?

(I thought Purdue was supposed to be one of the really good places for
Comp Sci.  Surely there must be _someone_ there who can give you face-
to-face help?  That's bound to be better than the Net.)
-- 
The problem about real life is that moving one's knight to QB3
may always be replied to with a lob across the net.  --Alasdair Macintyre.



More information about the Comp.lang.c mailing list