Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
When the programmer designs the logical flow of computations, the results of one step of computation are often used as data for another step. Hence, these results should be stored in memory and retrieved when needed again. In our first C++ program, one is added to the value denoted as y, and the result is used as the second argument in a call to function pow (it raises its first argument to the power of its second argument). To be able to store the value in memory and quickly access it for further use, the value should have a physical address in the computer memory. Since we do not want to use physical addresses in our source code, the value should have a symbolic name that the programmer will use in the program.
In Listing 2.1 and Listing 2.2, the sum of the value stored at location y and 1 is stored at a location that I called z. How the address and the name are connected is not a concern for the programmer; this is a problem for the compiler designer. The task of the programmer is to decide what values should be stored in memory and what names to use to denote these values. The technical term for the name that a programmer gives to a memory location is identifier. Actually, the programmer has to invent identifiers not only for variables, but also for such program components as constants, functions, data types, and labels (more about these components later).