20 Wrong questions (1)

Source: Internet
Author: User

The new semester started out quietly. This semester in addition to classes there is an important thing is to find a job, so want to calm down to prepare, these days for this semester study environment tangled, whether it is to the library laboratory or stay in the dorm to study well. Walked a circle around the edge to think that I should not be where to learn and Coke head, where to learn the most critical is a quiet heart, I can not always get used to the reasons for their low efficiency to the surrounding environment, more is to their own thinking. no matter where you can let yourself calm down to do things, this is the Battle of the position!

The first thing I want to do is prepare for the written test. Here are some of the recent mistakes in the process of doing written and C + + writing exercises, recorded so as to review, no longer make the same mistake in the same place.

Question (1):

Analysis: I think the growth direction of the stack is related to the processor architecture, impression is the impression, it seems that this is the answer: the growth direction of the stack and the growth direction of the heap, the heap grows when the address increases, the stack is reversed. As for the 4th answer, think of each process has its own independent stack, if anyone is very big that still got.

Question (2):

Analysis: In fact, this problem by the exclusion can be turned against it, then I will do wrong is affected by the A option, the inline function is only the content of the A option and the B option does not matter, can only show that the inline function is not enough to understand, because even if the inline function B option is also in the city, inline functions But it is at compile time to embed this piece of code at the call instead of the address of the function, inside the function of the variable with the same name as the global variable I would like to compile the compiler will do special processing.

Question (3):

Analysis: My answer is 4,4,4,4,4, standard answer is 21,4,4,4,4. The problem is that when sizeof operates on an array name, the result is the space size of the arrays, although we know that the array name represents the starting address (pointer) of the array. There is also a special case: the value of char p[5];sizeof (P[5]) is also 4, and the value of the 32-bit system is 4, as long as the variable that the sizeof operation is a pointer.

20 Wrong questions (1)

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.