书法字典:https://www.shufadict.com

类型转化:float -> DWORD

#include<iostream>
#include<windows.h>
using namespace std;


int main(void)
{
 float f = 1.1 ;
 DWORD d1 = (DWORD)f ;
 DWORD d2 = *(DWORD *)&f ;

 cout << d1 << endl ; // output: 1
 cout << d2 << endl ; // output: 1066192077

 system("pause") ;
 return 0 ;
}

posted on 2010-01-22 11:57  翰墨小生  阅读(1514)  评论(0编辑  收藏  举报

导航

书法字典:https://www.shufadict.com