C PROGRAMMING LANGUAGE
Hardeep Singh Rai
Jaswant Singh Taur
Preface
Way to work in Laboratory
Introduction
- Getting Started
- Variables and Arithmetic Expressions
- The For Statement
- Symbolic Constants
- Character Input and Output
- Arrays
- Functions
- Arguments: Call by Value
- Character Arrays
- External Variables and Scope
Types, Operators, and Expressions
- Variable Names
- Data Types and Sizes
- Constants
- Declarations
- Arithmetic Operators
- Relational and Logical Operators
- Type Conversions
- Increment and Decrement Operators
- Bitwise Operators
- Assignment Operators and Expressions
- Conditional Expressions
- Precedence and Order of Evaluation
Control Flow
- Statements and Blocks
- if-else
- else-if
- switch
- Loops: while and for
- Loops: do-while
- break and continue
- goto and labels
Functions and Program Structure
- Basics of Functions
- Functions Returning Non-integers
- External Variables
- Scope Rules
- Header Files
- Static Variables
- Register Variables
- Block Structure
- Initialisation
- Recursion
- The C Preprocessor
Pointers and Arrays
- Pointers and Addresses
- Pointers and Function Arguments
- Pointers and Arrays
- Address Arithmetic
- Character Pointers and Functions
- Pointer Arrays, Pointers to Pointers
- Multi-dimensional Arrays
- Initialisation of Pointer Arrays
- Pointers vs. Multi-dimensional Arrays
- Command-line Arguments
- Pointers to Functions
- Complicated Declarations
Structures
- Basics of Structures
- Structures and Functions
- Arrays of Structures
- Pointers to Structures
- Self-referential Structures
- Table Lookup
- Typedef
- Unions
- Bit-fields
Input and Output
- Standard Input and Output
- Formatted Output: printf
- Variable-length Argument Lists
- Formatted Input: scanf
- File Access
- Error Handling: stderr and exit
- Line Input and Output
- Miscellaneous Functions