CMDBID: 107370 | Course Code: WA1077,C | Duration: 5 Days
Overview>
This five day course teaches C programming.
Audience>
Programmers
Skills Gained>
Introduction
Operators in C
Control Flow
Functions
Pointers
Arrays in C
Structures in C
Handling Files in C
Miscellaneous Things
C and the Heap
Prerequisites>
Delegates attending this C training course should have a good working knowledge of programming techniques. No prior use of C is assumed, but limited exposure to the product would help.
Five days.
Outline>
Outline of C Programming Training 1. Introduction
Welcome to C
Course Objectives
Practical Exercises
Features of C
The History of C
Standard C vs. K&R C
A C Program
The Format of C
Another Example
Variables
printf and scanf
Integer Types in C
Integer Example
Character Example
Integers with different bases
Real types in C
Real Example
Constants
Warning!
Named Constants
Preprocessor Constants
Take Care With printf and scanf
2. Operators in C
Operators in C
Arithmetic Operators
Using Arithmetic Operators
The Cast Operator
Prefix and Postfix
Truth in C
Comparison Operators
Logical Operators
Bitwise Operators
Bitwise Example
Assignment
Other Assignment Operators
sizeof Operator
Conditional Expression Operator
Precedence of Operators
Associativity
Precedence/Associativity Table
3. Control Flow
Control Flow
if then else
Nesting ifs
switch
More about switch
while loop
Semicolon Warning!
while, not until!
do while
for loop
for is not until either!
Stepping with for
Extending the for loop
break
continue
4. Functions
The RulesWriting a Function
Calling a Function
Prototypes
Prototyping is Not Really Optional
Writing Prototypes
Take Care With Semicolons
Example Prototypes
Example Calls
Rules of Visibility
Call by Value
C and the Stack
Stack Example
Storage
auto
static
register
Global Variables
5. Pointers
Pointers
The "&" Operator
Rules
The "*" Operator
Writing Down Pointers
Initialisation Warning!
Initialise Pointers!
NULL
Fill in the Gaps
Type Mismatch
Reminder
Call by Reference
Pointers to Pointers
6. Arrays in C
Accessing Elements
Array Names
Passing Arrays to Functions
Using Pointers
Pointers Go Backwards Too
* and ++
Which Notation?
Strings
Printing Strings
Assigning to Strings
Pointing to Strings
Multidimensional Arrays
7. Structures in C
Concepts
Setting up the Template
Creating Instances
Initialising Instances
Structures Within Structures
Accessing Members
Unusual Properties
Passing Instances to Functions
Pointers to Structures
Why (*p).name?
Using p->name
Pass by Reference
Returning Structure Instances
Linked Lists
Example
Printing the List
Introduction
SOAC
typedef
9. Handling Files in C
Streams
What is a Stream?
Why stdout and stderr?
stdin is Line Buffered
Opening Files
Dealing with Errors
File Access Problem
Copying Files
Convenience Problem
Accessing the Command Line
Useful Routines
Binary Files
10. Miscellaneous Things
Unions
Remembering
Enumerated Types
Using Different Constants
The Preprocessor
Including Files
Pathnames
Avoid Temptation!
Preprocessor Macros
A Debugging Aid
Working With Large Projects
Data Sharing Example
Data Hiding Example
Use Header Files
Getting it Right
10. C and the Heap
What is the Heap?
How Much Memory?
Dynamic Arrays
Using Dynamic Arrays
calloc/malloc Example
realloc Example
realloc can do it all
Allocating Arrays of Arrays
Dynamic Data Structures
Linking the List
Our Clients
Our clients have included prestigious national organisations such as Oxford University Press, multi-national private corporations such as JP Morgan and HSBC, as well
as public sector institutions such as the Department of Defence and the Department of Health.