A89: Re: "Transfer" of values between C and ASM


[Prev][Next][Index][Thread]

A89: Re: "Transfer" of values between C and ASM




> alright sorry l think l got it now.  (This may be wrong) but if you do this:
> 
> int pointer;
> int a;
> a = 20;
> pointer = a;
> *pointer = 5
> 
> then a will now equal 5 and pointer will "contain" a?

No, you can't use pointers that way. Correct code would be this:

int a, *pointer;
a = 20;
pointer = &a;
&pointer = 5

I think =)
Pointers are one of the more tricky parts of C / C++.



 / Niklas Brunlid
Check out Prosit for the TI-89 / TI-92 Plus at http://c625.sparta.lu.se
Random PQF Quote follows:

"Luck is my middle name," said Rincewind, indistinctly. "Mind you, my first
name is Bad."
        -- (Terry Pratchett, Interesting Times)




References: