pointers in c++
Utilisateur anonyme
I mean this is a simple question. int* pi; // pointer to a memory segment where is an integer int* pd; // pointer to a memory segment where is a double sizeof(pi) == sizeof(pd) == sizeof(pAnything) == 4; // it is alway true on the 32 bit system (4*8 = 32) A pointer does not need initialise: int* pi; // correct expression. On the other hand a reference have to been initialised by another variable: int iVariable = 10; int& ri = iVariable; int& ri2; // compilation error