Constants in C are fixed values which cannot be changed during the execution of the program. In C, we can declare variables as constants in two ways. They are: 1) By using “const” keyword 2) By using “#define” preprocessor directive const Keyword We can declare a variable as a constant by using the const qualifier. A variable that is declared using const cannot change its value once it is initialized. The syntax of using the const is as shown below: Example of using the const keyword is as shown below: #define Preprocessor Directive We can also declare constants in a
The post How to create and work with constants in C Programming appeared first on Coding Security.
How to create and work with constants in C Programming
read more
Tidak ada komentar:
Posting Komentar