Pointers

Blitz3D Forums/Blitz3D Userlibs/Pointers

Zach3D(Posted 2005) [#1]
Do pointers really have any use? they just seem to be variables that you get the value to by using an address


GfK(Posted 2005) [#2]
they just seem to be variables that you get the value to by using an address
What do you think a pointer is??


KuRiX(Posted 2005) [#3]
Pointers are the most powerfull use of memory i have ever seen. Not only variable pointers, but function pointers.

The Real usages of pointers are not easy to implement. You can do polymorphism with function pointers for example, and with the use of C void pointer you can pass any kind of variable to a function.

The utility is infinite...


Picklesworth(Posted 2005) [#4]
You can sort of fake variable pointers in Blitz.
I'll be doing that, in a way, when I add a particular nice little feature to my program.

It will be incredibly slow, however. And I'm not optimizing it.


Neochrome(Posted 2005) [#5]
Blitz3D as i understand dont support TRUE pointers, the closest it has to "function" pointers i found is the Handle and Object function.

Please correct me if im wrong here though.


jfk EO-11110(Posted 2005) [#6]
And there are pointers to pointers and pointers that are pointing to pointers that are pointing to pointers and also the pointer sisters.

Never forget - in the beginning there where ONLY pointers. I remember I used them a lot to optimize speed. When I had to divide something by 16 in qbasic, I simply used "dpeek(varptr(a)+2)". well that was qbasic with physical 16 Bit Pointers and it didn't use the FPP, so this made sense.

In Blitz3D we have pseudo adresses to access Bank content. It still gives high flexibility.

Some people hacked some structures of BLitz lately, so you can use real 32 Bit pointers to banks and such, but this is real undocumented.

You see, you could give an external App or Dll the Pointer to a Blitz Bank, and all of a sudden the bank is full of nice bytes.