Reply To: C++ Programming

Ed P
Forumite Points: 16,464

Take the addresses of your peek and poke (say Pe and Po).

To peek just set a pointer to Pe (say pPe) then :

Pe = 0xCEff44  /* address in hex

void * pPe = (void *)Pe

if it is a char then use char* instead of void for other types of pointers such as struct etc

then just read the value pointed at by *pPe

printf(“value of peek = %d\n”, *pPe);

Poke is pretty much the converse look at this for more.

I recommend looking at C for obsolete uses such as peek and poke as they were deprecated about the time that C++ was released.