<<< C/C++ memory access | Index | The asterisk indicates the data type in memory >>> |
Specifying the data type was not a requirement on PDP-7, because PDP-7 supported only one uniform data type, an 18-bit integer:
MEMORY[ location ] = x; // save data in physical memory x = MEMORY[ location ]; // load data from physical memory
Later computer models begin to support data types of different sizes. Since then, the compiler requires an indication of the data type:
MEMORY[ (char*) location ] // access character in memory MEMORY[ (int*) location ] // access integer in memory MEMORY[ (float*) location ] // access float in memory MEMORY[ (double*) location ] // access double in memory MEMORY[ (bool*) location ] // access boolean in memory
<<< C/C++ memory access | Index | The asterisk indicates the data type in memory >>> |