Recent

Author Topic: Can someone please explain pointers..  (Read 34280 times)

devEric69

  • Hero Member
  • *****
  • Posts: 648
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: 6676
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
MT+86 & Turbo Pascal v1 on CCP/M-86, multitasking with LAN & graphics in 128Kb.
Pet hate: people who boast about the size and sophistication of their computer.
GitHub repositories: https://github.com/MarkMLl?tab=repositories

alpine

  • Hero Member
  • *****
  • Posts: 1038
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.  8-)
"I'm sorry Dave, I'm afraid I can't do that."
—HAL 9000

devEric69

  • Hero Member
  • *****
  • Posts: 648
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.  8-)

Lol. Yes: more demonstrative than brilliant :D !
« 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.

 

TinyPortal © 2005-2018