test void pointer before cast (instanceof)
Hi All
I've written the following test program
Code:
#include <stdio.h>
int main(void) {
char *c = "boss" ;
void * d = (void *)c ;
int *e ;
e = (int *)d ;
printf("%d char=%d int=%d\n", e, sizeof(char), sizeof(int)) ;
}
It prints: 8183 char=1 int=4
What does 8183 mean. It seems that the 4 chars fit into one int, so I would guess there might be a relation between 8183 and "boss". Can this cast be useful ?
But what if you don't know the original type of a void pointer, is there a way to determine it?
Thnx a lot!
LuCa