Why is this code valid? Shouldn't be constant pointers be also initialized at the time of declaration? | Sololearn: Learn to code for FREE!
Новый курс! Каждый программист должен знать генеративный ИИ!
Попробуйте бесплатный урок
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 ответ
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