What const means:

Declares values as constant, which means they can’t be changed further down the line without altering the declaration

Const means ‘constant’ and means you make it constant and cannot be changed or declared a different value than when it is first initialized.

I believe const means constant. So I feel like the variable with stay as an integer no matter what. If the value were to change then it needs to be another integer.

I think const is short for constant. Therefore meaning that when you declare a variable with const that variable will constantly output whatever was initially declared.

i think const is constant which keeps a declared variable occurring continuously in the programmed code

const is used as a means of telling the compiler that the value we assign is constant, that way, whenever the program runs, it will always know and remember the value that was assigned and will not change it unless asked to.

I believe that const will make the value unable to be changed. const = constant

When we prefix a variable using const, for example const int a = 10; We cannot change the variable as it is now constant. If we later on write a = 20 for example the IDE will be like “How do you expect me to change this constant variable? You yourself declared it constant!” :rofl:

“Const” means constant, therefore we are going to keep constatly the same value that we have
declared.

A const keyword is for declaring a constant variable. Therefore we can’t modify the value of that variable on runtime.

Const is an abbreviation for constant, which defines a variable with a fixed value and no longer allows changes to the variables. This type of data is useful, when we want to use constant variables throughout the program, ensuring that it does not change, even if the programmer forgets after a few lines of code, debubing refers that this variable is const type, either or, you cannot change a variable.
Regards Ana

const is part of the data type that allows the variable to not change at all. Sort of like a protection barrier, or a lock.

Hi there!

Const int keeps the variable inmutable to any future changes. The compiler will not allow it.

Thanks!

According to me const is used to prevent the variable from being changed during the program.

i think const is the short form of constant which means that we cant change the variables value afterwards and thus is no longer a variable but a constant

The const means constant.
When the int value is set to const, it no longer is variable and thus it can’t be changed in runtime.

const turns the int into something that can’t be changed - it’s now constant and can’t be reassigned

The const keyword is used for a value that will not be changed. It is immutable for instance a YOB in code would uses the const keyword as YOB never change.

A Const is a constant. A constant is something that stays the same and does not change

I was thinking the same “const” for constant. Making the value unchangeable and/or consistent throughout the code as per the namesake.

Privacy & Terms