C exam
(Judge big-end and small-end mode) Question 1: Write a c function. If the processor is big_endian, 0 is returned. If little_endian is used, 1 is returned.
Answer:
Int checkcpu ()
{
{
Union W
{
Int;
Char B;
} C;
C. A = 1;
Return (C. B = 1 );
}
Big-endian format, small-end formatBig-endian format:In this format, the high byte of the character data is stored in the low address, while the low byte of the word data is stored in the high address, 2.1:Figure 2.1Small End Format:In contrast to
"Big-endian" and "small end" can be traced back to Jonathan Swift's "Gulliver's Travels" in 1726, and one of the two countries was arguing over whether to break the larger end first or break the smaller end first, or even burst into war. In October 1
First, the origin of the big-endian mode and the small-end modeThere is an interesting story about the origin of the small end nouns, from Jonathan Swift's Travels of Gulliver: The two powerful powers of Lilliput and Blefuscu have been fighting for
can view/usr/include/limits.h fileIt defines the maximum and minimum values for each type..../* Minimum and maximum values a ' signed int ' can hold. */# define int_min (-int_max-1)
In a variety of computer architectures, the storage mechanism of byte, word and so on is different, which leads to a very important problem in the field of computer communication, that is, the Communication Information Unit (BITS, bytes, word,
The origins of big-endian and small-end patternsThere is an interesting story about the origin of the small end nouns, from Jonathan Swift's Travels of Gulliver: The two powerful powers of Lilliput and Blefuscu have been fighting for the past 36
Summing up, int (m) Zerofill, plus Zerofill after M to show a little bit of effect, such as int (3) Zerofill, you inserted into the database is 10, then the actual insert is 010, that is, add a 0 in front. if int (3) and int (10) Without Zerofill,
The big/little problem in problem Java
1. Solve the endian problem: a summary
Everything in the Java binaries is in the form of Big-endian, which is sometimes referred to as the network order. This is a good message, meaning if you only use Java.
Reprinted: http://www.eygle.com/digest/2007/01/whats_mean_endian.html
I. IntroductionIn various computer architectures, the storage mechanisms for bytes and words are different, leadingA very important issue in the field of computer communication,
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.