可能重複:
What does the 「L」 mean at the end of an integer literal?一個數字的末尾L是做什麼的?
例如
int one = 20;
int two = 20L;
cout << "one: " << one << " two: " << two << endl;
cout << "one: " << sizeof(one) << " two: " << sizeof(two) << endl;
輸出20然後4兩次兩次。
可能重複:
What does the 「L」 mean at the end of an integer literal?一個數字的末尾L是做什麼的?
例如
int one = 20;
int two = 20L;
cout << "one: " << one << " two: " << two << endl;
cout << "one: " << sizeof(one) << " two: " << sizeof(two) << endl;
輸出20然後4兩次兩次。
L表示long
沒有別的親愛....
大號告訴編譯器的數量是Long類型。 Long是一個大於或等於int大小的帶符號類型。在大多數現代編譯器中,這意味着該數字將佔用4個字節的內存。在大多數編譯器中,這恰好與int相同,所以在這種情況下不會產生影響。
long是使用gcc在mac os上簽名的,long是8字節長。 – Adrien
你是對的。不知道我在想什麼。固定。 –
我同意在發佈之前的搜索,但我不贊同它在相關鏈接中。 – Celeritas
它不在相關鏈接中,因爲我將它移動到「鏈接」部分。 –
但是沒有那麼不同,因爲它是一個宏,當聲明一個變量時,你指定'long'類型? – Celeritas