Introduction to C
Course
Inhouse
Description
-
Type
Course
-
Methodology
Inhouse
-
Duration
5 Days
In addition to the major exercises listed below, the course includes numerous mini-challenges and code examples for private study, and to build on the skills acquired during the course. Compiling a simple C program. Compiling an application containing several C modules (.c files). Creating data structures and applications that use them. Traversing and. Suitable for: Attendees are expected to have some programming experience in a procedural language such as Basic, Fortran or Pascal. The course is also suitable for recent engineering and computer science graduates who need to "cure" any bad (programming) habits they might have picked up at University. Drive and determination are important pre-requisites as the course aims to produce competent working programmers, as is a good sense of humour (vital when working under pressure). Good.
Reviews
Course programme
This is an intensive introduction to ANSI C programming using the GNU C compiler. At the end of the course attendees should be reasonably 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 disciplined 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 issuing commands at the commandline, or by invoking make on an appropriate makefile.
Key Skills
- Master the GNU C compiler
- Learn the syntax and usage of C
- Master the principles of working with dynamic data structures and algorithms
- Be able to save data to files and read data from files
- Understand the intricacies of makefiles and make
- Appreciate the need for version control and be able to work with SVN and CVS
- Master the techniques for writing well structured modular code in C
- Know how to use the GNU debugger
Practical Work
In addition to the major exercises listed below, the course includes numerous mini-challenges and code examples for private study, and to build on the skills acquired during the course.
- Compiling a simple C program
- Compiling an application containing several C modules (.c files)
- Creating data structures and applications that use them
- Traversing and processing information in one dimensional and multi-dimensional arrays
- Finding your way round the GNU documentation and help manuals
- Reading and writing text and binary files
- Creating and using indexed data structures
Course Contents
First steps
- How C became
- Getting to know the GNU C compiler
- The basic anatomy of a C program
- base data types and their sizes
- constants and declarations
- variable names
- arithemetic operators
- relational and logical operators
- increment and decrement operators
- increment and decrement operators
- assignment operators
- expressions
- operator precedence
- casting and type conversion
- if/else
- switch
- while , do-while and for-loops
- statements and blocks
- functions and function prototypes
- returning values from functions
- external variables and scope rules
- static variables
- call by value and recursion
- pointers and addresses
- pointers as arguments to functions
- arrays
- the relationship of pointers and arrays
- pointer arithmetic
- how C deals with multi-dimensional arrays
- arrays of pointers: their uses and initialisation
- strings and string functions
- fundamentals of structures
- passing structures as arguments to functions
- returning structures as return values from functions
- arrays of structures
- pointers to structures
- using pointers to structures to pass values to a function and return values from a function
- typedef and its uses in developing well structured and maintainable code
- sorting arrays of records
- allocating and freeing memory (malloc and free)
- linked lists and queues
- indexing (table lookup, binary trees, hashing)
- Standard input and standard output
- Formatted output: printf
- Formatted input: scanf
- The dangers of scanf
- File access and file I/O
- An overview of input-output in a windowing environment
- The MACRO pre-processor and how to use it wisely
- Unions
- Bit fields
- Date and Time functions in the C Standard Library
- Diagnostics- the assert macro
- Simple make files
- MACROS in make files
- Use of dummy targets
- Recursive makefiles
- Building and using libraries
- The importance of version control
- SVN / CVS
Introduction to C