Advanced C Language Programming
Revision: TE2102_20060318
Course Length:
5 Days
Course Description:
This course broadens the skills of a C language programmer by introducing sophisticated problem solving techniques including the advanced use of pointers, abstract data types, data structures, portability, and optimization techniques. Skills are reinforced by hands-on laboratory exercises.
Who Should Attend:
This course is for anybody who has been programming in C for at least six months or who is a skilled programmer and has taken a C introductory course.
Benefits of Attendance:
Upon completion of this course, students will be able to:
- Master the use of pointers in a wide variety of problems.
- Use sophisticated pointer techniques to solve problems involving advanced data structures such as lists, stacks, queues and trees.
- Choose from a wide variety of data structures to implement the most efficient solution to a problem.
- Apply the proper optimization technique to your C code.
- Apply many portability techniques to your C code.
- Use bit manipulation techniques for efficient solutions to problems.
- Write programs which emphasize modern program design techniques which emphasize code reuse.
- Write powerful C programs which make "calls" directly into the UNIX operating system through the use of system calls.
- Decrease development time in writing applications through a more thorough understanding of sophisticated concepts in C.
Prerequisites:
Students should have at least six months of C programming experience.
Course Outline:
- Chapter 1: Review Of C
- Fundamental data types
- Operators
- Control flow constructs - If
- Loops
- Switch
- Derived data types
- Arrays and pointers
- Structures
- Unions
- Bit Fields
- Enums
- Chapter 2: Functions
- Function fundamentals
- Function prototypes
- Return values
- Recursive functions
- Evaluation of function arguments
- Variable number of arguments
- Scope of variables
- Initialization
- Chapter 3: Bit Manipulation
- Defining the problem space
- Operators
- Writing bitwise functions
- Circular shifts
- Direct lookup
- Mapping with bits
- Radix sorting
- Chapter 4: Pointers
- Common pointer constructions
- Pointer arithmetic
- Command line arguments
- The environment pointer
- Processing arrays with pointers
- Simulating higher dimensional arrays
- Two dimensional arrays
- Complex declarations
- Pointers to functions
- Surrogate sorting
- Chapter 5: Designing Data Types
- Rationale for a new data type
- Creating the fraction type
- Implementing the fraction functions
- Applications with fractions
- Creating the set type
- Set representation
- Set function implementations
- Chapter 6: Data Structures
- Lists - What are they?
- Lists as arrays
- A list of linked elements
- The list data type
- List function implementation
- Other types of lists
- Ordered lists
- Circular lists
- Two way lists
- Networks
- A linked list application - hashing
- Stacks
- Queues
- Trees
- Chapter 7: Optimization Techniques
- Where to optimize
- Macros
- Initialization
- Modifying data structures
- Caching
- Removing invariants from loops
- Logical inefficiencies
- Odds and ends
- Chapter 8: Portability Issues
- Source code portability
- Portability with functions
- Arithmetic data types
- Bit manipulation problems
- Portable bit masks
- Pointer problems
- ANSI vs non-ANSI
- Odds and ends
- Appendix A: Software Tools
- Compiler options
- Conditional compilation
- Debugging with the assert macro
- Creating libraries
- A graphics example
- The make command
- The source code control system
- Appendix B: Useful Library Functions
- The system function
- Exit and atexit
- The signal function
- Strtok
- Memcpy and memset
- Qsort
- Bsearch
- Strstr
- String validation functions
- Appendix C: I/O File Access
- System calls vs library calls
- Opening disk files
- Access mode
- Errors in opening files
- I/O library calls
- The scanf functions
- Closing files
- Servicing errors
- Binary I/O



