0
Type on pointers
Normally every pointer can be defined as int right? So why is an pointer to a double variable not also an int ? Only to be consistent? Thanks, Leon
1 Resposta
0
it's because when you declare an int pointer, it is meant to point only to integer value. In c++, double and int are different datatypes. So a pointer of one type cannot point to a different datatype.