Major Member
|
引用:
Originally posted by 上善若水
harrisonlin 說的比我清楚,多謝了
1. (就如 harrisonlin 兄所說)
雞婆一下給個例子
std::cout << "lalala" << std::endl;
變成了
using namespace std;
cout << "lalala" << endl;
舊的 standard library (xxx.h) 就不需要 using namespace std; 或 加 std:: 了
2. 變數可使用/代表/儲存的範圍和"精確度"
eg.
int/short -32,768 ~ 32,767 (2 or 4 bytes)
long -2,147,483,648 ~ 2,147,483,647 (usually 4 bytes)
float/single 精確至 6 digits 範圍 1e-37 ~ 1e37 (4 bytes)
double 精確至 10 digits 範圍 1e-308 ~ 1e308 (8 bytes)
註 這些範圍和精確度不一定適用每一種電腦
至於 floating-point (real number) 的儲存/精確度其實不簡單
另有一門學問查查書吧
by the way, I can read/write chinese well, (way better than my english)
I typed in English because I can't input Chinese at uni
看的見中文, 但不能打,
中文退步太多, 而且中文打的很慢, 常注音拼不出來
ps. 我是台灣人(屏東) 只是現在住在鳥不生蛋的地方
|
--------------------------------------------------------------------
1)原來精確度包含這些範圍啊...
不過既然如此,都宣告為double不行了嗎?
"大"包"小"不是嗎?
還是非必要的話,宣告double會占用額外記憶體空間呢?
2)原來大家都是臺灣人,上善若水 兄你也太客氣了
哪兒是鳥不生蛋的地方啊?
|