数字末尾的L是什么? [英] What does the L at the end of a number do?
本文介绍了数字末尾的L是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
可能重复:
什么是L ?
Possible Duplicate:
What does the “L” mean at the end of an integer literal?
例如
int one = 20;
int two = 20L;
cout << "one: " << one << " two: " << two << endl;
cout << "one: " << sizeof(one) << " two: " << sizeof(two) << endl;
输出20两次,然后输出4次两次。
Outputs 20 twice then 4 twice.
推荐答案
在这种情况下, L
什么都不做。
In this scenario the L
does nothing.
一个数字给出常量的 long
类型之后,c $ c> L ,但因为在这种情况下,常量被立即分配给 int
变量没有改变。
The L
after a number gives the constant the long
type, but because in this scenario the constant is immediately assigned to an int
variable nothing is changed.
这篇关于数字末尾的L是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文