C Character Set – Letters, Digits & Symbols | BCA Sem 1 Notes | BKNMU Junagadh



BCA Sem 1  |  Unit 1  |  Computer Concepts & C Programming

C Character Set

Letters, Digits, Special Symbols, and Escape Sequences — The Fundamental Building Blocks of C

BKNMU Junagadh NEP 2020 Character Set ASCII Values Tokens & Identifiers
In simple words: The C Character Set is the complete collection of valid characters that a computer recognizes and allows you to use when writing C source code. Just as English uses alphabets from A to Z, C uses letters, digits, special symbols, and white space characters to construct constants, variables, operators, and expressions.
📖 Four Major Categories of C Character Set

When you write any program in C, the compiler groups every character into one of four primary categories:

A-Z & a-z

Letters (Alphabets)

Uppercase (A to Z) and Lowercase (a to z). C treats uppercase and lowercase differently.

0 to 9

Digits

Decimal digits from 0 through 9 used to form numbers, constants, and literal values.

+ - * / # $ &

Special Symbols

Punctuation and mathematical symbols used for operations, syntax blocks, and macros.

🎨 White Space & Escape Sequences at a Glance

Non-Printable Characters Recognized by C Compiler

\n (New Line) \t (Horizontal Tab) \0 (Null Character) \b (Backspace)
Spacebar Carriage Return \r
1️⃣ Comprehensive Breakdown of the C Character Set

Here is the detailed breakdown of all characters accepted by C compilers along with their roles:

CategoryCharacters IncludedASCII RangeUsage in C Program
Uppercase LettersA, B, C, ... Z65 to 90Macros, Constants, Identifiers
Lowercase Lettersa, b, c, ... z97 to 122Keywords, Variable names, Function names
Decimal Digits0, 1, 2, 3, 4, 5, 6, 7, 8, 948 to 57Literals, Numbers, Array indices
Special Symbols, . ; : ? ' " ! # % & * - + = < > ( ) [ ] { } ^ | / \ ~ $ @ _Various ASCIIOperators, Delimiters, Punctuation
White SpaceBlank Space, Horizontal Tab (\t), Carriage Return (\r), New Line (\n), Form Feed32 (Space), 9 (\t), 10 (\n)Separates tokens, ignored by compiler (except in strings)
ℹ️ ASCII Value Fact: Every character in the C character set corresponds to a unique 7-bit or 8-bit integer called an ASCII Code (American Standard Code for Information Interchange). For example, character 'A' has ASCII value 65, while 'a' has ASCII value 97.
🔍 Common Special Symbols and Their Purpose
Delimiters & Brackets
  • ( ) Parentheses: Function arguments & priority
  • { } Curly Braces: Code block boundaries
  • [ ] Square Brackets: Array dimension / indexing
  • ; Semicolon: Statement terminator
Operators & Pointers
  • + - * / % Arithmetic operations
  • & Address-of operator & Bitwise AND
  • * Pointer dereference & Multiplication
  • = == != Assignment and Comparison
Preprocessor & Special
  • # Preprocessor directive (e.g. #include)
  • _ Underscore: Only special character allowed in variable names
  • \ Backslash: Starts escape sequences
💻 Character Set in Action — Code Example

Observe how different categories of characters work together in a simple C code snippet:

/* Standard Input Output Directive */ #include <stdio.h> int main() { // Lowercase letters & digits forming variables int student_age = 20; // '_' is special symbol, '20' is digits char grade = 'A'; // 'A' is an uppercase letter // Escape sequence \n creates a new line printf("Age: %d\nGrade: %c\n", student_age, grade); return 0; }
💡 Student Note on Underscore (_): Among all special symbols, the underscore _ is special because C treats it like an alphabet! That means variable names can start with or contain underscores (e.g., _total_mark).
🔄 How Compiler Processes C Characters (Lexical Analysis)
1

Reading Raw Source Code

The compiler scans the .c text file character-by-character from top to bottom.

2

Filtering White Spaces & Comments

Extra spaces, tabs, newline characters, and comments are filtered out (except inside quoted strings).

3

Token Formation

Valid characters are grouped together to form C Tokens (Keywords, Identifiers, Operators, Constants).

⚠️ Important Exam Rule: C is Case-Sensitive! The character 'A' (ASCII 65) is NOT equal to 'a' (ASCII 97). Therefore, variable names Total, TOTAL, and total are three separate variables!
📝 Quick Revision — Key Exam Points
  • Definition: C Character Set is the set of letters, digits, and special characters valid in C language.
  • 4 Categories: Alphabets (A-Z, a-z), Digits (0-9), Special Symbols, White spaces.
  • ASCII Encoding: Each character has a unique integer ASCII value (e.g., 'A' = 65, 'a' = 97, '0' = 48).
  • Case Sensitivity: Uppercase and lowercase characters are distinct and non-interchangeable.
  • Underscore Exception: _ is the only special symbol allowed inside variable identifiers.
  • White Spaces: Space, Tab (\t), Newline (\n), Carriage return (\r) separate tokens.
  • Escape Sequences: Special two-character combinations starting with \ (e.g., \n, \t, \0).

Post a Comment

Thanks for comment.

Previous Post Next Post