A very simple test question of gele electronics is wrong !!!, Incorrect written test

Source: Internet
Author: User

A very simple test question of gele electronics is wrong !!!, Incorrect written test


Open the question picture and you will be able to see it.

Void main (void)

{Union unt

{Unsigned char uc [4];

Unsigned int ui;};

Union unt t;

T. ui = 0x12345678;

Printf ("% d \ n", t. uc [1]);}

 

The Community is rarely used in embedded development, so I didn't take a closer look at it during the review. Baidu once again, the variables in the community use the same bucket, that is, although I declare two variables in the Community, uc [4] and int ui, their addresses are actually the same. In this question, the uc array uses four bytes, And the ui integer is exactly four bytes. Therefore, the ui Initialization is equivalent to the uc initialization. If the array type is changed to int, the space occupied by this community is 4*4 = 16 bytes. "Each member shares a piece of memory space, the length of a federated variable is equal to the longest length of each member." For more information, see the Baidu encyclopedia.

Big and small ends are the structure of the data stored by the processor. Big ends are the low-level data stored at the low-level address, while small-end high-level data is stored at the high-level address. Therefore, from this question, we can see that uc [0] = 0x12, uc [1] = 0x34, uc [2] = 0x56, uc [3] = 0x78, so the answer should be B. Unfortunately, after reading the exam yesterday, I chose, the problem turned out to be a mistake in marking the foot of the array. Sorry, let's learn the lesson.


(Primary School) a mathematical problem (very simple, grade 5)

50 + 49 + 48-48-49 + 47 + 46 ......-4-3 + 2 + 1-1-2
= 50 + (49-49) + (48-48) + ...... + (1-1)
= 50 + 0 + 0 ...... + 0
= 50

Reason: the number of groups is regular.
Each four numbers can be a group starting from 2nd.
The sum of the four numbers is 0, for example, (49 + 48-48-49) = 0.
Except for 1st and 50, a total of 49 groups of the preceding arrays are 0.
So the answer is 0.
Ask me if you have any questions.

A mathematical question about data is very simple.

X + y + 99 + 100 + 101 = 100*5
-> X + y = 200 y = 200-x
(X-100) ^ 2 + (y-100) ^ 2 + 1 + 0 + 1 = 2*5
-> (X-100) ^ 2 + (100-x) ^ 2 = 8
X-100 | ^ 2 = 4
| X-100 | = 2
X = 102, y = 98 or x = 98, y = 102

Related Article

Contact Us

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.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.