C Course
This course is based on the first two sessions of the
BaBar C++ Course given all over the world by Paul F. Kunz from
Stanford Linear Accelerator Center.
These pages are still under construction.
Comments and suggestions for improvements are welcome
(I'm not an expert on C),
Peter Klok, pfk@hef.ru.nl.
Contents:
- Course Introduction
- Compile and Run a C Program
- Comments
- Main Program
- Input and Output
- More on I/O
- Standard Libraries
- Variable Declaration and Initialization
- Types
- Arithmetic Operators
- Exercise
- Relational Operators
- Logical Operators and Values
- Characters
- Bitwise Operators
- Assignment Operators
- Operator Precedence
- if Statement
- if else Statement
- Coding Styles
- while Loop
- while Example
- do-while Loop
- for Loop
- More Examples of for Loops
- break and
continue Statements
- Arrays
- Example Code and Test
- Functions
- Function Prototypes
- Declarations and Definitions
- Header Files and Definitions
- Header Files and User Code
- More on Declarations
- Functions and Compiler
- Header Files
- The (dreaded) Pointers
- Dereferencing Pointers
- Pointers and Arrays
- Pointers Arithmetic
- Examples
- Progression towards C style
- Examples of Pointer Arithmetic
- Dynamic Allocation of Arrays
- Example: Line Fit
- Example: Line Fit (continued)
- Character Strings
- Scope, Initialization and Lifetime of Variable
- Formal Arguments (1)
- Formal Arguments (2)
- Recursion
- More on Declarations
- const Pointer
- const Function Argument
C Course, 13-jan-2004, Peter Klok,
pfk@hef.kun.nl