DEV Community

Umid2008
Umid2008

Posted on

Constanta(C++)

So nows theme is Constanta. Constanta-const is an invariant. In the C++ programming language, we can use the utility word "const" to declare constants. Constanta is only possible to read the value (take). For example we have created a single variable that we use the constant so that it is preserved and does not change. It's very important code if you planning to create a large project.
int main1() {

int main1() {

const int Num = 34;
Num = 45

return 0;
}
In this code C++ gives 45 an error.
That's all!
Enter fullscreen mode Exit fullscreen mode

Top comments (0)