C Const Keyword

Last Updated Nov 1, 2015, 07:00:14 PM





const keyword is most useful with parameter passing. The const keyword is used to define constant values in the program

A constant variable is just like a hint that the assigned value shouldn't be changed during the program execution.

constants are useful for parameters which are used in the program but are do not need to be changed after the program is compiled. It has an advantage for programmers over the C preprocessor ‘#define’ command in that it is understood & used by the compiler itself, not just substituted into the program text by the preprocessor before reaching the main compiler, so error messages are much more helpful.

Const Keyword Example in C

Try It Now

Constants in C Programming