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.