我试图通过将 int 转换为 const CHAR* 来获取消息框以显示变量的地址,我当前的功能失调尝试如下所示:
#include <cstdlib>
#include <iostream>
#include <windows.h>
int main()
{
int *ip;
int pointervalue = 1337;
int thatvalue = 1;
ip = &pointervalue;
thatvalue = (int)ip;
std::cout<<thatvalue<<std::endl;
MessageBox (NULL, (const char*)thatvalue, NULL, NULL);
return 0;
}
dos 框打印 2293616,消息框打印“9|”