Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Setting memory address directly into pointer? (newby)

Status
Not open for further replies.

volkswagenb

Programmer
Jan 22, 2007
6
US
Hello everyone, am new to this forum, and i've been programming with C for a couple of years on and off now.

I'm basically trying to read a byte from a specific memory address, by using:

UINT8 value;
UINT8 *apointer;

apointer=0x1080;
value = *apointer

-But I get a 'type mismatch' error instead.
I was wondering if anyone knows how to set the pointer address directly like this in C. I hope is not a dumb question.

Context: I'm trying to read flash bytes on an embeeded device (Freescale HCS09)

-Thanks! :)


 
Try
Code:
apointer = (UINT8*) 0x1080;
 


Thanks a lot xwb !, sorry I'm replying so late.

I also hadn't figured out that getting a warning for "pointing to different types" wasn't necessarily bad, if that is what you need to do.
-Im still trying to fully understand pointers.

-thanks again :)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top