Toggle menu
Toggle preferences menu
Toggle personal menu
Not logged in
Your IP address will be publicly visible if you make any edits.

Constant: Difference between revisions

From Coderwiki
create Constant
(No difference)

Revision as of 21:05, 8 August 2025

Constants in programming are variables in which their value does not change during the runtime of the program.

Compile-time constants

Some programming languages evaluate constants at compile time. This means that their value is worked out by the compiler and is then hardcoded into the binary.

For these compile-time constants, they can't use any functions or data that is only available at runtime. For example, compile-time constants can't take in user input or call any other non-constant function.