? 數據庫的功能:用戶能對文件進行編輯、刪除、修改 等最簡單的功能!!!
? 希望高手能具體的用程序和我說明下!!!
? 非常感謝!!! 本人QQ328184275!!!
一個float變量的空間實體,被一個整形指針指向,當該指針間訪時,float變量的空間實體便現出整形實體的面相,于是34.5這個浮點數按二進制補碼來理解,得出的結果變得怪異了:
34.5=100010.1
(2)
????????=1.000101*2
5(2)
????? =0,10000100,00010100000000000000000
結果變成
2
30+2
25+2
19+2
17=1107951616
原來的程序為
#include<iostream>
using namespace std;
int main()
{ float f= 34.5;
int *ip= reinterpret_cast<int*>(&f);
cout<<"float address: "<<&f<<"=>"<<f<<endl;
cout<<" int address: "<<ip<<"=>"<<*ip<<endl;
*ip=100;
cout<<" int: "<<*ip<<endl;
cout<<" float: "<<f<<endl;
}
上面的34.5=100010.1
(2)
????????=1.000101*2
5(2)
????? =0,10000100,00010100000000000000000我看不太懂 希望能得到你們的指點
有如下程序
#include<iostream>
using namespace std;
int main()
{cout<<("join"=="join" ? "":"not")<<"equal\n";
getchar();
char* str1="good";
char* str2="good";
cout<<(str1==str2 ? "": "not")<<"equal\n";
getchar();
char buffer1[6]="hello";
char buffer2[6]="hello";
cout<<(buffer1==buffer2 ? "" : "not")<<"equal\n";
getchar();
}
書上顯示編譯后結果是
not equal
not equal
not equal
但是我編譯后顯示的結果是
equal
equal
not equal
請高手指點指點哦!!