Possible Duplicate:
What is the difference between an int and a long in C++?
#include <iostream>
int main()
{
std::cout << sizeof(int) << std::endl;
std::cout << sizeof(long int) << std::endl;
}
<<>Output>:
4
4
如何做到这一点? 是否应将int
?
Possible Duplicate:
What is the difference between an int and a long in C++?
#include <iostream>
int main()
{
std::cout << sizeof(int) << std::endl;
std::cout << sizeof(long int) << std::endl;
}
<<>Output>:
4
4
如何做到这一点? 是否应将int
?
保证:
sizeof(int) <= sizeof(long)
sizeof(int) * CHAR_BITS >= 16
sizeof(long) * CHAR_BITS >= 32
CHAR_BITS >= 8
所有这些条件都符合:
sizeof(int) == 4
sizeof(long) == 4
C++ langauge never guaranteed or required long int
to be bigger than int
. The only thing the language is promising is that long int
is not smaller than int
. In many popular implementations long int
has the same size as int
.
它取决于语言和平台。 例如,在ISO/ANSI C中,64-bit系统“简讯”中的长期惯性为8 by,其他电动/电压为4.。
页: 1 根据<代码>int的C标准,该标准具有与int
long int相同,int
与longt
或相同,甚至所有三者相同。 在16台轨道机上,在<代码>sizeof(int)
=sizeof(short int)
=2和
sizeof(long int)
=== 关于32台轨道机的最常见安排是sizeof(int)
=sizeof (long int)
== 8.8=4和
=4,和<条码>sizeof(长期为t)sizeof(short int)
=== 2. 在64台轨道机上,可找到<条码>(直线)条码>=2,<条码>sizeof(int)
见。
没有任何东西错。 数据型的大小一般是硬件依赖方(但总有1个大范围登记的文件除外)。 在加热/大学, in头和长期都需要4个 by子。 你们还可以尝试(长时间的)规模,看看结果和规模(迅速)。
I m getting this linker error. I know a way around it, but it s bugging me because another part of the project s linking fine and it s designed almost identically. First, I have namespace LCD. Then I ...
I have been searching for sample code creating iterator for my own container, but I haven t really found a good example. I know this been asked before (Creating my own Iterators) but didn t see any ...
Is there an equivalent to tidy for HTML code for C++? I have searched on the internet, but I find nothing but C++ wrappers for tidy, etc... I think the keyword tidy is what has me hung up. I am ...
I m new to C++ and am wondering how much time I should invest in learning how to implement template classes. Are they widely used in industry, or is this something I should move through quickly?
Given a 10 digit Telephone Number, we have to print all possible strings created from that. The mapping of the numbers is the one as exactly on a phone s keypad. i.e. for 1,0-> No Letter for 2->...
Why is it when i do the following i get errors when relating to with wchar_t? namespace Foo { typedef std::wstring String; } Now i declare all my strings as Foo::String through out the program, ...
I cannot figure out how to marshal a C++ CBitmap to a C# Bitmap or Image class. My import looks like this: [DllImport(@"test.dll", CharSet = CharSet.Unicode)] public static extern IntPtr ...
Is it possible to check with the means of pure X11/Xlib only whether the given window is iconified/minimized, and, if it is, how?