static_cast <type> (expr)
#include "stdafx.h"
#include <iostream>
using namespace std;
int _tmain(int argc, _TCHAR* argv[])
{
int i;
float f;
f = 199.22F;
i = static_cast<int> (f);
cout << i << endl;
return 0;
}
欢迎光临 曲径通幽论坛 (http://www.groad.net/bbs/) | Powered by Discuz! X3.2 |