|
You still need to allocate memory, however. Just because you "lock" the memory doesn't mean that it exists.
As for your message box thing: you've got to allocate some memory for the pointer. You've got two options here:
1. change display from a char * to a char[32]. (or some other sub-script)
2. allocate some memory via new. Ie. display=new char[32]. If you do this, don't forget to delete it once you're done with it.
If you don't do this, all you've got is a pointer to, usually, 0xcdcdcdcd (or something like that), which isn't valid. When itoa tries to copy text to this location, it's going to crash because there is no memory there to copy it to.
--Rob
|