[University of Leicester]

Computer Centre

Computer Centre

Introduction to C Programming

So you want to learn C? We hope to provide you with an easy step by step guide to programming in C. The course is split up into several sections, or lessons, which include C example programs for you to demonstrate what has been taught. Although the ordering of the sections does not have to be strictly followed, the sections become progressively more involved and assume background knowledge attained from previous sections. Good Luck!


Before you start....

  1. Please read this Introduction.
  2. It is a long course and will take you quite a while to complete. If you use the Hotlist or Bookmark feature of your browser you will be able to return to the place where you left off at or to return to a particular section.
  3. This tutorial should be viewable on any WWW browser - if you have any problems please let us know!.


The Course Section Topics

  1. Overview of C.
    1. Why use C?
    2. Uses of C
    3. A Brief History of C
    4. C for Personal Computers

  2. Running C Programs.
    1. Using Microsoft C.
    2. Unix System.

  3. Structure of C Programs.
    1. C's Character Set
    2. The form of a C Program
    3. The layout of C Programs
    4. Preprocessor Directives

  4. Your First Program.
    1. Commenting Programs.

  5. Data Types - Part I.
    1. Integer Number Variables.
    2. Decimal Number Variables.
    3. Character Variables.
    4. Assignment Statement.
    5. Arithmetic Ordering.
    6. Something To Declare.

  6. Input and Output.
    1. printf.
    2. The % Format Specifiers.
    3. Formatting Your Output.
    4. scanf.

  7. Control Loops.
    1. The while and do while Loops.
    2. Conditions, or Logical Expression.
    3. The for Loop.

  8. Conditional Execution.
    1. Program Control - if , if else etc..
    2. Using break and continue Within Loops.
    3. Select Paths with switch.

  9. Structure and Nesting.

  10. Functions and Prototypes.
    1. Functions - C's Building Blocks.
    2. Functions and Local Variables.
    3. Getting the Value of Variables into Functions.
    4. Functions and Prototypes.
    5. What is ANSI C?.
    6. Standard Library Functions.

  11. Data Types - Part II.
    1. Global Variables.
    2. Constant Data Types.

  12. Arrays.

  13. Pointers.
    1. Point To Point.
    2. Swap Shop.
    3. Pointers Linked To Arrays.

  14. Strings.
    1. Stringing Along.
    2. As easy as... B or C?.
    3. A Sort OF Bubble Program.

  15. Structures.
    1. Defining A New Type.
    2. Structures and Functions.
    3. Pointers To Structures.
    4. Malloc.
    5. Structures and Linked Lists.
    6. Structures and C++.
    7. Header Files.

  16. File Handling.
    1. Stream Files.
    2. Text File Functions.
    3. Binary File Functions.
    4. File System Functions.
    5. Command Line Parameters.

  17. Recommended Books.

  18. Course Assessment Form.

  19. Example Programs Database.

  20. Appendix: C's functions.

You've now reached the end of this online tutorial. We have covered a lot of ground - but this has been a first course in C and there is still plenty to learn. However, as long as you keep in mind that C is an essentially simple language and how new features are built from this simplicity you shouldn't have many problems.

You also need to be aware of the fact that C is a very low-level language and as a result allows programmers to confuse data types and muck around with the bit patterns of the data in a way that higher level languages would disown! You probably need to make sure that you understand binary and the way that values are represented to get the best from C.

The final question is, where should you go next? If you have enjoyed learning C then you probably need to move on to C++ the language most likely to reign supreme in the future! Watch this space for online tutorial!  
Tutorials

[University Home][Computer Centre Home][University Index A-Z][University Search][University Help]

Last updated: 08 May 1998 09:59
Document owner: University CWIS Maintainer
 
Computer Centre Web maintainer

This document has been approved by the head of department or section.
If you are an authorised user you may edit this document through your Web browser.