+ 3
Can I assign the address of a integer variable to the float pointer?
for example int a=4; float *aPtr; aPtr = &a;
3 Respostas
+ 4
Declaring a pointer to be a specific type tells the compiler when the pointer is dereferenced the value pointed to will be of that type.
if you run a code like that one, it would give an error: "cannot convert 'int* ' to 'float*' in inicialization", You can only assign addresses to pointers of the same type.
+ 3
no
+ 1
here in this site has some answers about this http://stackoverflow.com/questions/19710601/any-type-of-pointer-can-point-to-anything