Industrial manufacturing
Industrial Internet of Things | Industrial materials | Equipment Maintenance and Repair | Industrial programming |
home  MfgRobots >> Industrial manufacturing >  >> Industrial programming >> C Language

C Keywords & Identifiers: A Practical Guide

C Keywords & Identifiers

Discover the core C language elements – reserved keywords and how to name identifiers correctly. This concise guide is built on years of real‑world C development experience.

Character Set

A character set defines the characters that can appear in identifiers and other parts of a C program.

Alphabets

Uppercase: A B C … X Y Z
Lowercase: a b c … x y z

C accepts both uppercase and lowercase letters for variable and function names.

Digits

0 1 2 3 4 5 6 7 8 9

Special Characters

Special Characters in C Programming
,<>._
();$:
%[]#?
'&{}"
^!*/|
-\~+ 

Whitespace characters include space, newline, tab, carriage return, and form feed.


C Keywords

Keywords are reserved words that the compiler recognizes and that cannot be reused as identifiers. They form the backbone of C syntax.

int money;

Here, int is a keyword indicating that money is an integer variable.

Because C is case‑sensitive, all keywords must be written in lowercase.

Below is the full list of ANSI C keywords, a reference that every C developer should master:

C Keywords
autodoubleintstruct
breakelselongswitch
caseenumregistertypedef
charexternreturnunion
continueforsignedvoid
doifstaticwhile
defaultgotosizeofvolatile
constfloatshortunsigned

For a deeper dive into each keyword’s syntax and use cases, see List of all keywords in C programming.


C Identifiers

An identifier is the name you assign to variables, functions, structs, and other entities. Identifiers must be unique within their scope.

int money;
double accountBalance;

In the example above, money and accountBalance are identifiers.

Remember: an identifier cannot be a keyword; for example, you cannot name a variable int.


Rules for Naming Identifiers

  1. A valid identifier may contain letters (uppercase or lowercase), digits, and underscores.
  2. The first character must be a letter or an underscore.
  3. Keywords are forbidden as identifier names.
  4. Identifier length is unlimited in theory, but many compilers limit it to 31 characters. Stick to reasonable lengths for portability.

Choose descriptive names that convey intent—good naming practices improve code readability and maintainability.

C Language

  1. Understanding C# Keywords and Identifiers: Rules, Lists, and Best Practices
  2. Mastering C++ Variables, Literals, and Constants: A Comprehensive Guide
  3. Python Keywords and Identifiers: Mastering Reserved Words and Naming Conventions
  4. C Tokens, Identifiers, and Keywords: Understanding Tokens and Their Types
  5. Leveraging Robotics for Faster, Safer Aerospace & Defense Production
  6. Generative Design & Continuous 3D Fiber Deposition: AI-Driven Innovation
  7. Thermography Explained: How Infrared Imaging Detects Temperature Variations
  8. Revolutionizing Packaging: Advanced Robotics & Automation for Faster, Safer Shipments
  9. Navigating the Global Semiconductor Shortage: Impact and Solutions
  10. Carbon‑14 Dating: Unlocking Material Histories in Science & Industry