+ 3
Wrong pointer-datatype?
What happens when I use a pointer of one datatype to point to a variable of another? Let's say I have a double variable and I use an int pointer to point to it. Does it matter? If it doesn't, why do we have to give pointers datatypes?
2 Antworten
+ 2
it does matter, the pointer data type simply tells the program hey I want to look at this type of data. if you use let's say int x, char * y; It will tell you it cannot convert to int * from char*
+ 1
no problem if done with char or ints
but with other data types it does matter