Home > Back-end >  Constant storage issues
Constant storage issues

Time:09-29

Where there is a constant?
For example:
int a, b;
A=b + 3;
The 3 where there,
Such as:
# define PI 3.1415920
Where the PI deposit,

Thank you very much!

CodePudding user response:

no

CodePudding user response:

http://edu.csdn.net/course/detail/2344 C language pointer and assembly - a memory address. The code element

CodePudding user response:

PI is the macro, in precompiled, PI will be replaced with 3.1415920
For 3,3.1415920 these number immediately, using the way of addressing immediately, when performing to the corresponding statement, directly to the variable is stored in the mov instruction address, or to register, is stored in the mov for operation

CodePudding user response:

Can be seen in the disassembly code, for a=b + 3 this kind of expression, 3 is not stored in registers, which directly use, is upstairs friend said, the number immediately addressing

For the # define PI 3.14.1920
This macro, can be seen in the disassembly code, is stored in the memory of the

CodePudding user response:

Stored in memory, data segment,

CodePudding user response:

3 don't store, see assembly can know, it is a number immediately,

3.1415925 PI can be thought of as stored in a read-only data (data segments are divided into read-only and can be read to write two parts, the Linux)

CodePudding user response:

reference 6 building self-confidence boy reply:
3 are not stored, see assembly can know, it is a number immediately,

3.1415925 PI can be thought of as stored in a read-only data (data segments are divided into read-only and can be read to write two parts, the Linux)
no
3.1415925 and 3
As for the PI does not exist

CodePudding user response:

reference 6 building self-confidence boy reply:
3 are not stored, see assembly can know, it is a number immediately,

3.1415925 PI can be thought of as stored in a read-only data (data segments are divided into read-only and can be read to write two parts, the Linux)
correct 3.1415926 does memory
And the PI or not save
There is no
after a precompiledThe compiler can't see this symbol let alone to save the PI

CodePudding user response:

refer to the second floor 4 teacher zhao response:
http://edu.csdn.net/course/detail/2344 C language pointer and assembly - a memory address. The code elements

The teacher you pulled from the shelves this lesson?

CodePudding user response:

The 3? 3 is a constant, never store,

Most is just a temporary variable, the but the number in the computer will be stored in binary, pay attention to the
  • Related