In C ++, constants are constants, such as int A = 5 and 5. So where does a constant exist? Is memory used?
# Include <iostream. h>
Int;
Main (void)
{
A = 10;
Cout <A <Endl;
Cout <& A <Endl;
Cout <& 10 <Endl; // invalid
Return 0;
}
The preceding section is from vc6.0.Code: The following message is displayed during compilation: Error c2101: '&' on constant. That is, you cannot use the address operator for constants. This constant is 10 inProgramIn what form does the running process exist? How does one complete the assignment operation? If you have learned the assembly language, you may be familiar with the following command:
MoV ax, #5 the specific format is not clearly remembered, it is to move the value to the Register ax 5. in this case, 5 exists in the Code zone in the form of immediate number: embedded into the command. When the command is executed, the format of the preceding command is assigned to global or local variables. This operation does not need to be written into the stack, so it will not exist in the data storage area in the form of data: heap, stack, static data zone. And also embedded