Contents
How to use incompatible pointer type in C-stack overflow?
1. …or a char *, unsigned char * or signed char * object, because there’s a special rule for those. In your prototype declaration , you said second argument as void** ,so you have to type cast double** to void** . Instead of this line success = dequeue (queueIn, &target);. Use it like this. Thanks for contributing an answer to Stack Overflow!
What happens if you assign different types of pointers?
Even worse, the size of different types of pointers may not be equal. Hence, if your function doesn’t know what type of pointer it should assign, it cannot just “put the data in the address”, because the size of the right pointer may be different from the size of the pointer it assign.
Are there different types of pointers in C?
In C, there is a void* type for general pointer, but there is not a type for general pointer to pointer. Even worse, the size of different types of pointers may not be equal.
Can you pass target as a two level pointer?
I thought that if I passed target as a two level pointer that it would work, but I guess I’m wrong. Can someone please explain to me how come i’m getting this warning?
Are there pointer types that pass a string?
Im writing a funtion that takes string as a argument and gives back a integer. This function counts lenght of a string entered at the command line argument. I get an error :” incompatible pointer types passing ‘string’ (aka ‘char *’) to parameter of type ‘string *’ (aka ‘char **’) “.
Can a double pointer be converted to a void?
When you write it like this, the conversion from void * to double * is explicit, which allows the compiler to do any magic that’s necessary (even though in the overwhelmingly common case, there’s no magic at all). 1. …or a char *, unsigned char * or signed char * object, because there’s a special rule for those.