### Bookstore

 Computer Math and Games in Pascal (preview) Lazarus Handbook

### Recent

#### devEric69

• Hero Member
• Posts: 515
##### Re: Can someone please explain pointers..
« Reply #45 on: June 24, 2021, 08:59:07 pm »
Basically, and to take an image, a pointer could be seen as one of the traffic panels on a crossroads, each pointing to its own distant city (i.e. each to its variable). The address of a pointer (for ex., @pTowardsBigCity) could be seen as the location of the city named "BigCity". Following a pointer, i.e. dereferencing it (pTowardsBigCity^), means to follow its direction, in order to reach the desired address, to arrive at the variable that we want to know, to see (i.e. to visit the desired city). There are many crossroads, each with its traffic panels. So, each crossroad, traffic panel, has its address too (for ex., unit1.@@pTowardsBigCity versus unit2.@@pTowardsBigCity), to possibly distinguish them from each other (practical, if they all point to the same city, in one region).
« Last Edit: June 25, 2021, 10:03:38 am by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.

#### MarkMLl

• Hero Member
• Posts: 2843
##### Re: Can someone please explain pointers..
« Reply #46 on: June 24, 2021, 09:02:55 pm »
Basically, and to take an image, a pointer could be seen as one of the traffic panels on a crossroads, each pointing to its own distant city (i.e. each to its variable). The address of a pointer (for ex., @pTowardsBigCity) could be seen as the location of the city named "BigCity". Following a pointer, i.e. dereferencing it (pTowardsBigCity^), means to follow its direction, in order to reach the desired address, to arrive at the variable that we want to know, to see (i.e. to visit the desired city). There are many crossroads, each with its traffic panels. So, each crossroad, traffic panel, has its address too (for ex., @@pTowardsBigCityFromTrafficPanelNum1), to possibly distinguish them from each other (practical, if they all point to the same city, in one region).

And to extend the metaphor, it's undesirable for anybody but the civic authority to start setting them up on their own account.

MarkMLl
Turbo Pascal v1 on CCP/M-86, multitasking with LAN and graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

#### y.ivanov

• Full Member
• Posts: 185
##### Re: Can someone please explain pointers..
« Reply #47 on: June 24, 2021, 10:01:40 pm »
I've just found what pointers and setters are.

#### devEric69

• Hero Member
• Posts: 515
##### Re: Can someone please explain pointers..
« Reply #48 on: June 24, 2021, 10:14:41 pm »
I've just found what pointers and setters are.

Lol. Yes: more demonstrative than brilliant !
« Last Edit: June 24, 2021, 11:08:42 pm by devEric69 »
use: Linux 64 bits (Ubuntu 20.04 LTS).
Lazarus version: 2.0.4 (svn revision: 62502M) compiled with fpc 3.0.4 - fpDebug \ Dwarf3.