reinterpret_cast <type> (expr)
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int i;
char *p = "Hello World";
i = reinterpret_cast<int> (p); //将指针转换为整数
cout << i;
return 0;
}
12212272
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |