• void pointer to struct pointer cast
    I declared a void pointer void *ptr; and a typedef struct named testStructure, with a member 'unsigned int a'. Now I will cast this pointer to a struct pointer: ptr=(testStructure*)malloc...
  • void pointer to struct pointer cast
    I declared a void pointer void *ptr; and a typedef struct named testStructure, with a member 'unsigned int a'. Now I will cast this pointer to a struct pointer: ptr=(testStructure*)malloc...
  • void pointer behaviour ?
    Hi, I observed a strange behaviour (for me only) of void pointer. I wrote a code to access an integer through void pointer as below: void *ptr; int a[2] = {1,2}; ptr = (int *)&a; ptr++; /...
  • void pointer behaviour ?
    Hi, I observed a strange behaviour (for me only) of void pointer. I wrote a code to access an integer through void pointer as below: void *ptr; int a[2] = {1,2}; ptr = (int *)&a; ptr++; /...
  • Can someone advice for pointers for void objects?
    void *MyConfigDetail; if (x) { ((TType1 *) MyConfigDetail) = DetailCacheBeans; } else { ((TType2 *) MyConfigDetail) = DetailailCacheHam; } </rpr> But I am unable to access the "MyConfigDetail" elements...