0

Whats the difference between these two?

const int SIDE; SIDE = 10; And const int SIDE = 10;

13th May 2020, 4:31 AM
Dark AR
Dark AR - avatar
2 Respuestas
0
hello Dark AR const makes a variable constant, i.e. const int side side = 10;//will give error, it’s constant you cant declare const with the declaration now you can do, i.e. const int side = 10; // this is true
13th May 2020, 5:57 AM
Ishan Shah
Ishan Shah - avatar
+ 1
A constant should be initialized at the time of declaration because it can not be re-initialized. First one will give you error, second will not.
13th May 2020, 5:34 AM
Raj Chhatrala
Raj Chhatrala - avatar