I'm working on a c++ programm since some days, all was going well, but now I have found some little trouble with pointers. I am working with SDL and I want is to convert a pointer to a struct(namely SDL_Surface) to an int(or other numeric type). And also convert the int to the pointer again.
I still don't know if that's possible. If not, I will have to do things in an other much complicated way...
Code:
SDL_Surface* pic = NULL;
pic = IMG_Load("test.png"); // Loads the image
int pointer;
pointer = {pic to int}; // Pointer to int, what {pic to int} should be?
SDL_Surface* pic2 = pointer; // Int to pointer