Course Description
In this five-day hands-on course students learn how to write, enhance, debug, and maintain C programs. Students learn how to write major numerical, text-processing, interactive, and database programs in C.
Course Objectives
Upon successful completion of this course, students will be able to:
- Write and debug interactive C programs.
- Use the variety of data types appropriate to specific programming problems.
- Utilize the modular features of C.
- Write efficient and easy-to-read C programs.
- Demonstrate the use of the various control flow constructs.
- Use pointers and arrays to efficiently solve software problems.
- Create their own data types.
- Use functions from the portable C library.
- Read and write data to and from files.
- Write C programs to perform complex mathematical calculations.
Course Benefits
Linux is written in C. Many other important computer programs are written in C. In this course, students learn how to program in C. By learning how to program in C students will be able to write, support, and enhance many important computer programs written in C.
Who Should Attend
This course is valuable for anyone who has been tasked with revising, building, managing, supporting, or maintaining a C programming project, and anyone who needs to learn C.
Prerequisite
To ensure your success, we recommend you first take either our Introduction To UNIX course or our Introduction To Linux course, or have the equivalent knowledge. Familiarity with a text editor, and basic UNIX/Linux command line interface is assumed.
Method Of Instruction
Lecture, demonstrations, questions and answers, and numerous hands-on exercises.
Hands-on Exercises
Throughout this course, students perform a numerous hands-on exercises, including:
- Simple print statement
- Simple and complex
for
loops- Simple and complex
while
loops- Character counting
- Line counting
- Word counting
- Complex if-else
- Sorting
- Programs with arguments
- Formatting output
- Calling system functions
- Interactive programs that check for user input error
- Bernoulli trial
- Data type conversion
- Temperature conversion
- Solving simple geometry and engineering problems using functions
- Character manipulation
- Concatenate strings
- Reading and writing to files
- Solving mathematical equations
- Using
switch
andcase
- Using pointer and arrays
- Using external variables
- Recursive function call
- Finding patterns in strings
- Using arrays to manipulate text
- Using pointers to address memory
- Using pointers to manipulate arrays
- Using pointers and structures
- Using unions and typedef
- Using arrays to perform matrix arithmetic
Course Outline
Chapter 1: Introduction to C ProgrammingChapter 2: Types, Operators and Expressions
- Variables and Arithmetic
- The For Statement
- Symbolic Constants
- Arrays
- Functions
- Arguments
- Character Arrays
- External Variables
Chapter 3: Control Flow
- Variable Names
- Data Types and Sizes
- Constants
- Declarations
- Arithmetic Operators
- Relational and Logical Operators
- Type Conversions
- Increment and Decrement Operators
- Bitwise Logical Operators
- Assignment Operators and Expressions
- Conditional Expressions
- Precedence and Order of Evaluation
Chapter 4: Functions and Program Structure
- Statements and Blocks
- If-Else
- Switch
- Loops
- Break
- Continue
- Labels
Chapter 5: Pointers and Arrays
- Function Arguments
- Functions Returning Non-Integers
- External Variables
- Scope Rules
- Static Variables
- Register Variables
- Block Structure
- Initialization
- Recursion
- The C Preprocessor
Chapter 6: Structures
- Pointers and Addresses
- Pointers and Function Arguments
- Pointers and Arrays
- Address Arithmetic
- Character Pointers and Functions
- Pointers are not Integers
- Multi-Dimensional Arrays
- Pointer Arrays
- Pointers to Pointers
- Initialization of Pointer Arrays
- Command-line Arguments
Chapter 7: Input and Output
- Structures and Functions
- Arrays of Structures
- Pointers to Structures
- Self-referential Structures
- Tables
- Fields
- Unions
- Typedef
Chapter 8: System Interface
- Access to the Standard Library
getchar
andputchar
printf
scanf
andsscanf
- In-memory Format Conversion
- File Access
- Error Handling
- Line Input and Output
- Additional Functions
- File Descriptors
- Read and Write
- Open and Close
- Linking