Created: 2023-01-11 10:55
Status: #concept
Subject: Programming
Tags: C Variable

Identifier

They are the unique names for Variables, Functions, Macro Definition, and other entities (Structs).

Naming Rules

in C and Python

Their syntax is similar to Python where the first character has to be a letter or underscore or $, NOT a number.

It accepts all characters except special characters other than underscore after the first letter.

C is case-sensitive when it comes to identifiers: sum != Sum.

DON’T USE UNDERSCORES AS STARTING CHARACTERS - it’s bad programming practice outside Python class methods.

int times10, get_next_char, _done;

Illegal Identifiers

int 10times, get-next-char, super%;
/* will cause compiler error: "stray <special char> in program" */

References