Why is this code valid? Shouldn't be constant pointers be also initialized at the time of declaration? | Sololearn: Learn to code for FREE!
Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis
0

Why is this code valid? Shouldn't be constant pointers be also initialized at the time of declaration?

const int i=5; const int* p; p=&i;

7th Jan 2018, 6:23 AM
Prarthit Mehra
1 Resposta
0
but shouldn't it give compilation error coz it's not initialized at the time of declaration?
8th Jan 2018, 7:05 AM
Prarthit Mehra