Every programming language has constant values that we used at the time of programming. Today, we will understand character constants in C. How they work? and how we can use them in any programme.
Character constants in C
These are the fixed character values that we use in our program. Basically we store these constant values in any character type variable.
Keep in mind, always put a single quote (‘) before and after the constant value.
char x='m'; char p='n';
You can see above two character constant values ‘m’ and ‘n’ respectively used in x and p variables.
Practically we use this kind of values in a program where we need a fixed value and that will not change.
You can also read
- What is a computer program and programming
- What are the programming languages? Explain
- What are identifiers in C language
- Comments in C: How to use in a program?
Hope that you understand the concept of a character constants in C.
You can also visit my other blog based on blogging tips and tricks.