C Programming Notes
C Character Set
The C character set includes letters (A-Z, a-z), digits (0-9), special symbols (+, -, *, /, etc.),
and white spaces.
Identifiers and Keywords under ANSI C
Identifiers are user-defined names for variables, functions, and arrays. Keywords are
reserved words predefined by C such as int, float, return, if, etc.
Data Types
C has various data types including int, float, double, and char.
Constants
Constants in C include integer constants (10, 20), floating constants (10.5, 20.3), character
constants ('A', 'B'), and string constants ("Hello").
Qualifiers: long, short, unsigned, and signed
Qualifiers modify the range of data types. Example: short int, long int, unsigned int.
Escape Sequences
Escape sequences represent special characters in strings. Example: \n (new line), \t (tab), \
b (backspace).
Arithmetic Expressions and Operators
C provides various operators such as + (addition), - (subtraction), * (multiplication), /
(division), and % (modulus).
Preprocessor Directives
Preprocessor directives are instructions processed before compilation, such as #include
and #define.
Concept of Header Files
Header files contain function prototypes and macro definitions. Example: stdio.h, math.h.
Symbolic Constants
Defined using #define or the const keyword. Example: #define PI 3.14.
Comments
Comments help in code documentation. Single-line comments use // and multi-line
comments use /* */.
sizeof Operator
The sizeof operator returns the memory size of a data type or variable. Example: sizeof(int)
returns 4 on a 32-bit system.
Steps in Translation of a C Program
The process includes preprocessing, compilation, assembly, linking, and execution.