0

What is constant data type?

C language

10th Mar 2020, 7:15 PM
Makane Santosh
Makane Santosh - avatar
4 Answers
+ 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
10th Mar 2020, 7:23 PM
Sudarshan Rai
Sudarshan Rai - avatar
+ 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.
10th Mar 2020, 8:57 PM
voja
voja - avatar
+ 2
Const will allow the value not to be changed by a third party
10th Mar 2020, 7:21 PM
✳AsterisK✳
✳AsterisK✳ - avatar
+ 2
Think of a tuple in python. It's a data type that can't be changed.
10th Mar 2020, 8:16 PM
Inkosi
Inkosi - avatar