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:

  1. Course Introduction
  2. Compile and Run a C Program
  3. Comments
  4. Main Program
  5. Input and Output
  6. More on I/O
  7. Standard Libraries
  8. Variable Declaration and Initialization
  9. Types
  10. Arithmetic Operators
  11. Exercise
  12. Relational Operators
  13. Logical Operators and Values
  14. Characters
  15. Bitwise Operators
  16. Assignment Operators
  17. Operator Precedence
  18. if Statement
  19. if else Statement
  20. Coding Styles
  21. while Loop
  22. while Example
  23. do-while Loop
  24. for Loop
  25. More Examples of for Loops
  26. break and continue Statements
  27. Arrays
  28. Example Code and Test
  29. Functions
  30. Function Prototypes
  31. Declarations and Definitions
  32. Header Files and Definitions
  33. Header Files and User Code
  34. More on Declarations
  35. Functions and Compiler
  36. Header Files
  37. The (dreaded) Pointers
  38. Dereferencing Pointers
  39. Pointers and Arrays
  40. Pointers Arithmetic
  41. Examples
  42. Progression towards C style
  43. Examples of Pointer Arithmetic
  44. Dynamic Allocation of Arrays
  45. Example: Line Fit
  46. Example: Line Fit (continued)
  47. Character Strings
  48. Scope, Initialization and Lifetime of Variable
  49. Formal Arguments (1)
  50. Formal Arguments (2)
  51. Recursion
  52. More on Declarations
  53. const Pointer
  54. const Function Argument


C Course, 13-jan-2004, Peter Klok, pfk@hef.kun.nl