Recently in the study, I suddenly thought, I in 64-bit environment, int range of values have changed? To detect this result, I did the following test:1, Environment: Win7 flagship 64-bit +VS2010 SP1 (version number: 10.0.40219.1sp1rel) +.net 4.0.3031
A question arises:In 32-bit machines, the int range is-32768 ~ 32767Instead of-32767 ~ 32767-How can I get 32768?
========================================================== ============Message Group: Group/record ()=======================
int integral type in Visual C + + is typically represented by four bytesto store an int in a computer in the form of a complement (for a positive number whose complement is equal to the original code),Complement of numbers from 0000 0000 0000 0000 00
1. This should start with the binary original code (digital logic-teacher dongye ):If the highest bit is used as the symbol bit, the maximum binary original code is 0111111111111111 = the 15th power of 2 minus 1 = 32767The minimum value is 1111111111
At first see Int16, Int32, Int64 These three kinds of types feel a bit strange, why want the whole number end of, very strange.Yesterday thought to each other, Ms so do is to let everyone at a glance know how much space this data type.Int8, equal to
4.3.3 for Loop: Within a range ... Each of them ...Since the while statement and Do...while ... Statements have been able to meet the needs of our expression loop phenomenon, why should C + + specifically provide a For statement to express the loop
Just like int A, int can also be decorated with other modifiers. In addition to the void type, the base data type can be preceded by a variety of type modifiers, such as the following four types of modifiers:1.signed----Signed, can be decorated with
4.3.3 for Loop: Within a range ... Each of them ...Since the while statement and Do...while ... Statements have been able to meet the needs of our expression loop phenomenon, why should C + + specifically provide a For statement to express the loop
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.