in some api's you have a pointer to a pointer. it would be nice, if the pb syntax would accept "**" as prefix to a variable name. the program/compiler shouldn't do anything other, than now. with "**" it would be more clear, that this is a pointer to a pointer.
Josh wrote:in some api's you have a pointer to a pointer. it would be nice, if the pb syntax would accept "**" as prefix to a variable name. the program/compiler shouldn't do anything other, than now. with "**" it would be more clear, that this is a pointer to a pointer.
Josh wrote:in some api's you have a pointer to a pointer. it would be nice, if the pb syntax would accept "**" as prefix to a variable name. the program/compiler shouldn't do anything other, than now. with "**" it would be more clear, that this is a pointer to a pointer.
What would you use to signify a pointer to a pointer to a pointer ... ad infinitum? You would spend all your time counting asterisks trying to figure out what was being pointed at. As you pointed out the function would be the same, it is just a pointer (to whatever).
jamirokwai wrote:
Just curious... What is this about? For what could you need this?
It's used on C for dynamic arrays for example. The array pointer is a pointer to a array of pointers which point to the rows of the array. If i understood it right. I dont used it because it sounds horribly unoptimized.
jamirokwai wrote:Is it then possible to get the type of a variable or structure?
As I don't code in C or C++, I am not familiar with pointer to pointer things
i'm also not coding in c or c++
using "*" says nothing about the type of variable or structure, so, if it would be possible to use "**" this would also say nothing about type or structure. but if i can use **variablename, i see at the first view, that this is a pointer to a pointer and than i can dereference to *variablename and then dereference to variablename.
IIRC, pointers to pointers are used on Windows/DirectX to have a concept of dynamic interfaces. E.g. You have a pointer to a function DrawSprite (stupid example) which itself is a pointer in an array of pointers to the real function. When initializing DirectX the init functions set the pointer to either DirectX5 6 or 7 functions, depending on what you asked init to do, what is available and what is compatible.
I might be wrong, it is 7 years since i last did any DirectX programming.