Subtotal C/C ++ (1), subtotal c

Source: Internet
Author: User

Subtotal C/C ++ (1), subtotal c

This article mainly records the following two problems:

Here is a brief introduction to my environment: Win7 32-bit, Qt creator 5.4.1 compiler MinGW4.9.2 32bit Debugger: gnu gdb 7.8

On the Internet, it is misleading to say that when there is a signed number or an unsigned number in the expression, the unsigned number is converted to a signed number and then calculated. actually, it should be like this: when the expression contains a number of signed and unsigned numbers, the calculation result is converted to unsigned. Besides, you should pay attention to the usage scenarios. When your expression is used for comparison judgment and direct calculation output, there are two different results, as shown below:

For this question, you need to know a function atexit (that is, at exit. You should understand this. When exit exits). For details about this function, refer to Baidu encyclopedia. Function: registers the termination function (that is, the function called after the main execution ends ). Sample Code:

In this way, I think it is impossible to understand this function. So I want to see how the Assembly runs, so it is as follows:

From the Assembly perspective, when return 0 is executed, it does not end immediately. Instead, the Assembly jumps and exits only after other commands are run. Maybe this function has not been actually used and cannot be deeply understood. If the content is incorrect, please note that.

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.