What exactly is a pointer variable? This is a variable that contains the address of another variable, function or data. We will resume function pointers in another lesson, but in this lesson, you will learn about defining and using pointers to data and variables.
Most computers have a large block of memory. Programs are loaded into the bright portion of this memory and a small portion (usually from 1 MB) is used to contain local variables (stack) and return addresses and the rest (or a part thereof) is used for general storage and is called the heap.The program itself is prepared in memory sections, primarily consisting of program code initialized data (strings, etc.) and the space for the variables. On Windows, the file format is called portable executable and is used for the object code, executable files and DLLs in the System 32 and 64-bit. .NET uses an extended version of PE. Linux uses ELF (executable and linking format).
Because operating systems to run several programs at the same time, the program code never runs at a fixed address in RAM but can be moved by the system. While C++ includes an operator to give the address of a variable, you can never rely on the same address, whenever you run the program. This is probably the same relative to the beginning of the program, but the program can be moved by the operating system.
We usually have to worry about the impact of the architecture, but a pointer address can vary between tracks, but must remain the same for execution of an application.
No comments:
Post a Comment