Next:
Copyright Notice and
Up:
C Programming
Previous:
C Programming
Contents
Contents
Copyright Notice and Credits
Introduction
About C
C and UNIX
This Course
Dialects of C
Common C
ANSI C
A Quick Overview of C
A Very Simple Program
A Weight Conversion Program
Weight Conversion Table Using a Function
Weight Conversion with a Prompt
Weight Conversion with Command Line Argument
Fibonacci Series Using an Array
Using C with UNIX
Writing the Program
Compiling the Program
The C Compiler (cc)
Make, a Program Builder
Improved Type Checking Using Lint
Running the Program
Constant and Variable Types
Variables
Variable Names
Global Variables
External Variables
Static Variables
Constants
Arrays
Expressions and Operators
Assignment Statement
Arithmetic operators
Type conversion
Comparison
Logical Connectors
Summary
Control Statements
The if else Statement
The switch Statement
Loops
The while Loop
The do while Loop
The for Loop
The break Statement
The continue Statement
The goto Statement
Functions in C
Scope of Function Variables
Modifying Function Arguments
Pointers in C
Arrays and Pointers
Recursive Functions
Input and Output
The Standard Input Output File
Character Input / Output
getchar
putchar
Formatted Input / Output
printf
scanf
Whole Lines of Input and Output
gets
puts
Handling Files in C
UNIX File Redirection
C File Handling - File Pointers
Opening a file pointer using fopen
Standard file pointers in UNIX
Closing a file using fclose
Input and Output using file pointers
Character Input and Output with Files
Formatted Input Output with File Pointers
Formatted Input Output with Strings
Whole Line Input and Output using File Pointers
Special Characters
NULL, The Null Pointer or Character
EOF, The End of File Marker
Other String Handling Functions
Conclusion
Structures in C
Defining a Structure
Accessing Members of a Structure
Structures as Function Arguments
Further Uses of Structures
The C Preprocessor
Using #define to Implement Constants
Using #define to Create Functional Macros
Reading in Other Files using #include
Conditional selection of code using #ifdef
Using #ifdef for Different Computer Types
Using #ifdef to Temporarily Remove Program Statements
Programs with Several Files
Advantages of Using Several Files
How to Divide a Program between Several Files
Organisation of Data in each File
Compiling Multi-File Programs
Separate Compilation
Using make with Multi-File Programs
UNIX Library Functions
Finding Information about Library Functions
Use of Library Functions
Some Useful Library Functions
Precedence of C operators
Special Characters
Formatted Input and Output Function Types
Some Recommended Books
C Language Keywords
Usable SUN Systems
About this document ...