In this blog post, you will learn about the C keywords their character sets. Like other languages, C has some character sets and keywords (reserved words). It is good to know some important character sets and keywords in C because it will help during the programming.
C language character set:
- Lowercase and uppercase letters of ISO Basic Latin Alphabet: a–z A–Z
- Decimal digits: 0–9
- 29 graphic characters! ” # % & ‘ ( ) * + , – . / :
; < = > ? [ \ ] ^ _ { | } ~ - Whitespace characters: space, horizontal tab, vertical tab, form feed, newline (Newline indicates the end of a text line), carriage return, backspace,..etc.
Keywords in C (Reserved words):
Keywords are words that have special meaning to the C compiler. They are predefined (You can’t redefine it), reserved words used in programming. C89 has 32 reserved words. These keywords are case sensitive and only use for the purpose of which they are predefined.
Note:
We can not use keywords as an identifier in the programs. Let’s understand with an example C program.
#include <stdio.h> int main() { int while; //variable return 0; }
Output:
Compiler error.
Explanation: Getting compiler error because using while keyword as an identifier.
Except for these old keywords, C99, C11, and C23 have some extra keywords. Below I have mentioned some new keywords which were introduced in C99, C11, and C23.
C99
C11
C23
- _Decimal128
- _Decimal64
- _Decimal32
Update list of keywords, you should know:
It is the newly updated list of reserved keywords in C.
auto break case char const continue default do-while double else enum extern |
float for goto if inline (since C99)int long register restrict (since C99)return short |
signed sizeof static struct switch typedef union unsigned void volatile while |
_Alignas (since C11)_Alignof (since C11)_Atomic (since C11)_Bool (since C99)_Complex (since C99)_Decimal128 (since C23)_Decimal32 (since C23)_Decimal64 (since C23)_Generic (since C11)_Imaginary (since C99)_Noreturn (since C11)_Static_assert (since C11)_Thread_local (since C11) |
Recommended Post
- Token Pasting Operator in C/C++ programming.
- Learn how to use the typedef in C.
- Macro in C, you should know.
- enum in C,7 application.
- You should know the volatile Qualifier.
- 100 embedded C Interview Questions.
- Interview questions on bitwise operators in C
- 10 questions about dynamic memory allocation.
- File handling in C.
- 100 C interview Questions.
- Pointer in C, A Brief Introduction.
- C format specifiers.