×

Character Set in C

Introduction

Every language has some basic elements which are used to represent information. The English language includes alphabets which together shape a sentence, after which the sentences are used to shape a paragraph.

Like every language, C also contains a set of characters which are used to represent information. The set of characters in C included alphabets, digits and special symbols. The language supports 256 characters in total.

Every program in C language consists of statements. The statements contain words, and the words are further constructed using characters from characters set in C.

The character set in C consists of the following set of characters:

  1. Alphabets
  2. Digits
  3. Special Symbols

Note: The characters set in C are both machine and user readable since they are from human understandable language.

Need of Characters

Every language has some basic elements which are used to represent information. The English language includes alphabets which together shape a sentence, after which the sentences are used to shape a paragraph, similar to this, a combination of different types of characters forms a program. The characters are building blocks to write a program.

Classification of Characters in C

The characters in C are classified into two types:

Source Characters

 

Alphabets

Digits

Special characters/symbols

White Spaces

Execution Characters

 

 

Source Characters

1) Alphabets:

The alphabets in ANSI C are the same as alphabets in the English language. Every alphabet in the english language is supported by the C language too and, this includes both upper and lowercase letters which together sums upto 52 alphabets.

  1. Lowercase letters - a to z
  2. Uppercase letters - A to Z

Note: The lowercase (small letters) and uppercase (caps letter) are distinct in the C programming language.

2) Numerical Digits:

The C language supports a total of 10 digits. These digits lie in the range from 0 to 9 and are used to construct numerical values.

Digits: 0,1,2,3,4,5,6,7,8,9

3) Special Symbols:

There are various types of special symbols supported by the C language. This rich set of special symbols includes symbols to perform;

  • Mathematical operations
  • Condition checking
  • White spacing
  • Backspaces

The following are the special characters contained by the C language language with their symbols and meaning:

Symbol   Meaning  
 ~ Tilde
 !Exclamation mark
 $Dollar sign
 #Number sign
Lest parenthesis
 )Right parenthesis
_Underscore 
 +Plus sign
%Percent sign 
 ^Caret
 &Ampersand
  *Asterisk
 | Vertical bar
  \ Backslash
 ` Apostrophe
 " Quotation mark
 ; Semicolon
 < Opening angle bracket
 > Closing angle bracket
  ? Question mark
 , Comma
 .Period
  / Slash
 - Minus sign
 = Equal to sign
  { Left brace
  } Right brace
 [ Left bracket
] Right bracket
 :  Colon
 - Minus sign

Execution Characters

The execution characters in C are the characters which are invisible on the display window or console. The execution characters are related to ASCII values which are understood by the computer when a certain command is passed to the computer.

Conclusion

Every language has some basic elements which are used to represent information. Like every language, C also contains a set of characters which are used to represent information.

Character Set in C language

Alphabets : a to z and A to Z
Digits :        0,1,2,3,4,5,6,7,8,9
Symbols :   ~, &, %, $, *, ^
Space :       Blank, back, tab etc

Related Topics

Booleans in C

Introduction to Boolean With all the complexities of programming, it can take time to understand the basics. One concept, in particular, that confuses many beginners is the use of Booleans in...

6 minutes read.

While Loop in C programming examples

Introduction There is always a header file containing all the essential data regarding inputs and outputs of various functions in the C programs. The following statement describes how to use/add header file...

22 minutes read.

Difference between If Else and Nested If Else in C

What is the If Else statement in C? In C programs, if else conditions are used to perform some operations based on specific conditions. The operation is only executed if the...

6 minutes read.

Flow chart of While loop in C

This is a flowchart that represents the process of executing the while loop in the C programming language.Generally, as we know there are three main components of while loop:1. The...

3 minutes read.

What are linker and loader in C

Linker and loader are utility programs that have a significant role in executing a program. Linker: A linker is a program that joins the object files produced by the assembler/ compiler...

3 minutes read.

Fibonacci Series in C Using For Loop

In this C article, we will let you know about the procedure of displaying the Fibonacci series of the first “n” positive integers. The syntax of for loop used in the...

4 minutes read.

memcpy() in C

Introduction: Here we discuss about the memcpy() function in C. The memcpy() function is also called the Copy Memory Block function. Used to create a copy of a specific drawing...

4 minutes read.

C and C++ Binary Files

What is a binary file? A file in which the content is written in binary format is called a binary file. A binary file is not a text file. There are...

7 minutes read.

First Fit Program in C

This is one of the easiest ways to allocate memory. The main goal is to divide the memory into several fixed sizes. In C, there is only one process for...

3 minutes read.

Write() function in c

As the name suggests the write () function is used to write the file descriptor. In other words it is used to write any file name without specifying file name,...

3 minutes read.

C program to compare the two strings

C program to compare the two strings Strings can be compared either by using the string function or without using string function. First, we will look at how we can compare the strings with...

4 minutes read.

Advantages of Dynamic Memory Allocation in C

Dynamic Memory Allocation Dynamic memory allocation is a process of assigning or allocating memory to a variable during the execution of a program. Dynamic memory allocation provides storage according to the...

3 minutes read.

fork() in C

Introduction To create a new function in the system, there is a need for a system call, i.e. fork system call. It is also known as the child process. These child...

2 minutes read.

Purpose of a Function Prototype in C

A function prototype in C is a declaration of a function that specifies the function's name, return type and parameters. It has the following syntax: return_type function_name(parameter_list); For example, the prototype for...

4 minutes read.

Inline Function in C

Inline Function in C A normal function will become an inline function when the function prototype of that function is prepended with the keyword "inline". Inline functions are the function where...

4 minutes read.

Quick sort in C

Quick-sort, in the same way, like a merge sort, follows the principle of the divide and conquer algorithm. It then picks an element as pivot and partitions, and the given...

4 minutes read.

Deadlock Detection Program in C

What is Deadlock? A deadlock is a circumstance where a group in the process is halted because they are each holding onto resources while waiting for other methods to obtain them. Think...

5 minutes read.

How to convert a string to hexadecimal in C

Converting a character array or any string to its respective hexadecimal form is simple. The only thing we have to do is to follow the below steps. Take each character from...

3 minutes read.

How to use Typedef Struct in C

The “typedef” is a predefined keyword in C programming language which is used to declare the new name to an existing type of variable. For better understanding, if you declare a...

3 minutes read.

Floyd’s triangle in C

Floyd’s triangle in C Floyd’s triangle is named after a person Robert Floyd. It is a right-angled triangle that is of natural numbers starting from 1 and consecutively selects the upcoming...

4 minutes read.