0
What is constant data type?
C language
4 ответов
+ 5
// As name constant it's a fixed value in program, which remains same during your program execution ,It can't be changed.
//Here are some similar threads about C constant data
https://www.sololearn.com/discuss/1750994/?ref=app
https://www.sololearn.com/discuss/827029/?ref=app
+ 4
Well there are different kind of constants:
-Constants,
-Named Constants
there are also
-Constant Variables
What they have in common is that their values can't be changed.
Examples are the best way to explain this:
int num = 42;
// here, 42 is simply a constant
#define MAX_CHARS 100
// in this example, MAX_CHARS is named constant.
const int num = 10;
// in this example, num is constant variable.
+ 2
Const will allow the value not to be changed by a third party
+ 2
Think of a tuple in python. It's a data type that can't be changed.