D A R K - C O D E R

Loading

C Programming – Constants

Constants refer to a situation or simulation that does not change at any cost and is known as constants. In C programming, the constant is used to declare fixed values that can’t be changed or altered during its execution or after its execution.

Constants are also known as literals.

Constants do not bound to any specific data type it could be any data type like integer constants, it could be floating constants, or it could be character constants. Although the enumeration is also constant they can’t change once they are declared.

Spy Note:

Constants are the same as normal variables but they cannot be modified or altered once they are defined. After the definition of the constant, it’s impossible to change its value. 

Constant is mostly used to store applications credentials, folder paths, and math rules like( pi value ), etc.

Example :

const int dark_coder = 110;

After declaring the variable as the content its values will remain the same, it’s not editable, or alterable. in a more simple way, Constant is just read-only variables.

It’s important to know that value can only assign to a constant once declare constant, after that the program holds the same value.