I know this is not possible in C and it may sound as a stupid question.
Anyway, has anybody any idea if this can be avoided by some tricks of some sort?
Its' all about typecasting a (void *) pointer to an appropriate type recieved as a parameter.
I would like to know as much as possible about the type of a pointer, how that exactly works. I know that a pointer is a 32 bit value, that basically holds the memory adress of a variable and the type of the pointer is used by the compiler, when dereferencing the data in the pointer.
Well, i would like to be able to have the necesary information about a pointer type, passed as an function argument.
How can it be done?
Compilers do it, so it has to be done in C, in some manner.
I have a general idea, but it involves too much code writing, so i would like some clues.
Thanks in advance.
Anyway, has anybody any idea if this can be avoided by some tricks of some sort?
Its' all about typecasting a (void *) pointer to an appropriate type recieved as a parameter.
I would like to know as much as possible about the type of a pointer, how that exactly works. I know that a pointer is a 32 bit value, that basically holds the memory adress of a variable and the type of the pointer is used by the compiler, when dereferencing the data in the pointer.
Well, i would like to be able to have the necesary information about a pointer type, passed as an function argument.
How can it be done?
Compilers do it, so it has to be done in C, in some manner.
I have a general idea, but it involves too much code writing, so i would like some clues.
Thanks in advance.