gbadev.org forum archive

This is a read-only mirror of the content originally found on forum.gbadev.org (now offline), salvaged from Wayback machine copies. A new forum can be found here.

Beginners > Pointer mess up

#110786 - QuantumDoja - Fri Dec 01, 2006 3:27 pm

Hi, I have this code:

Code:

int myvalue = 60;
int *myptr;
myptr = &myvalue;


Im expecting *myptr to equal 60 but its coming out as 50356336 - any ideas?
_________________
Chris Davis

#110788 - QuantumDoja - Fri Dec 01, 2006 3:36 pm

please ignore the post above, Im losing my mind.....note to self: Make sure you always call the function before checking the result of the function.....doh!
_________________
Chris Davis