I have a pointer and I would like to convert the pointer address to a string and display the address in a message box. Is there a function similar to printf() that can format a string? This does not seem to work.
#include <windows.h>
#include <stdio.h>
int WINAPI WinMain(
HINSTANCE hThisInstance,
HINSTANCE prevInstance,
LPSTR lpszArgument,
int nFunsterStil)
{
int x = 5;
int* ptr = &x;
MessageBox(NULL, printf("%p", ptr), "Pointer", MB_OK);
return 0;
}
Thanks for any help.