Why is this code valid? Shouldn't be constant pointers be also initialized at the time of declaration? | Sololearn: Learn to code for FREE!
Nouvelle formation ! Tous les codeurs devraient apprendre l'IA générative !
Essayez une leçon gratuite
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 Réponse
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