Introduction to C
Course Description
This is an intensive introduction to ANSI C programming using the GNU C compiler. At the end of the course attendees should be reasonable confident in reading and writing C programs and have a good practical understanding of advanced topics such as the use of C pointers, the relationship between pointers and arrays, as well as dynamic memory allocation and memory management. In addition, they will be able to understand makefiles and version control using RCS and CVS.
Throughout, the course will emphasise a disaplined and structured approach to C programming. Debugging and code testing techniques will also be covered extensively, including the use of the GNU debugging tools. The course is not based on any particular Integrated Development Environment (IDE), and adopts a more traditional approach where files are created using a suitable editor (such as EMACS) and programs are compiled either by idduing commands at the commandline, or by invoking make on an appropriate makefile.
5 Days
Contact us for pricing
Prerequisites
Attendees are expected to have some programming experience.First Steps
How C becameGetting to know the GNU C compiler
The basic anatomy of a C program
Data types, operators and expressions (the basics)
Base data types and their sizesConstants and declarations, variable names, arithemetic operators
Relational and logical operators
Increment and decrement operators, assignment operators, operator precedence
Expressions, casting and type conversion
Program flow control
If - else, switch, while, do-while and for-loopsStatements and blocks
Functions
Functions and function prototypesReturning values from functions
External variables and scope rules
Static variables, call by value and recursion
Pointers and arrays
Pointers and addresses, pointers as arguments to functions, pointer arithmeticArrays, the relationship of pointers and arrays, arrays of pointers - their uses and initialisation
How C deals with multi-dimensional arrays
Strings and string functions
Structures
Fundamentals of structures, arrays of structures, pointers to structuresPassing structures as arguments to functions
Returning structures as return values from functions
Using pointers to structures to pass values to a funtion and return values from a function
Typedef and its uses in developing well structured and maintainable code
An introduction to data structures and algorithms
Sorting arrays of records, allocating and freeing memory (malloc and free)Linked lists and queues, indexing (table lookup, binary trees, hashing)
Input-output
Standard input and standard outputFormatted output - printf
Formatted input - scanf, The dangers of scanf
File access and file I/O
An overview of input-output in a windowing environment
Further topics
The MACRO pre-processor and how to use it wiselyUnions, Bit fields
Date and Time functions in the C Standard Library
Diagnostics-the assert macro
Makefiles, Libraries, RCS and CVS
Simple make files, MACROS in make files, Recursive makefilesUse of dummy targets
Building and using libraries
The Importance of version control
RCS and CVS
C Programming