Current location - Plastic Surgery and Aesthetics Network - Plastic surgery and medical aesthetics - What's the difference between a constant and a constant?
What's the difference between a constant and a constant?
A "constant" is a quantity that will not be modified when the program is running. In other words, although constants serve hardware, software and programming languages, they are not introduced because of hardware, software and programming languages.

Constants are divided into different types, such as 25, 0 and -8 are integer constants, 6.8 and -7.89 are real constants, and' a' and' b' are character constants. Constants can usually be judged from their literal forms. This constant is called literal constant or direct constant.

Variable, which comes from mathematics, is an abstract concept in computer language. It can store calculation results or represent numerical values. Variables can be accessed by their names. In imperative languages, variables are usually variable; But in a purely functional language (such as Haskell), variables may be immutable. In some languages, variables may be clearly defined as abstractions that can represent the state of variables and have storage space (such as in Java and Visual Basic). But other languages may use other concepts (such as the object of C) to refer to this abstraction, without strictly defining the exact extension of "variable".