Skip Navigation Links

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 C code.
  • Apply many portability techniques to C code.
  • Use bit manipulation techniques for efficient solutions to problems.
  • Write programs that emphasize modern program design techniques which emphasize code reuse.
  • Write powerful C programs that 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: A Review of C
    1. Data Types
    2. Operators
    3. Control Flow Constructs - if
    4. Loops
    5. switch
    6. Derived Data Types
    7. Arrays
    8. Array vs. Pointer
    9. Arrays and Pointers
    10. Structures
    11. Header File for a Structure
    12. Use of Structures
    13. Structure References
    14. Structure Assignments
    15. Unions
    16. Bitfields
    17. Enumerations
  • Chapter 2: Functions
    1. Function Fundamentals
    2. Function Prototypes
    3. Function Invocation and Definition
    4. Subprogram Examples
    5. Functions Returning a Value
    6. Return Value Considerations
    7. Recursive Functions
    8. Evaluation of Function Arguments
    9. Variable Number of Arguments
    10. Scope of Variables
    11. Storage Class Attributes
    12. Initialization
  • Chapter 3: Bit Manipulation
    1. Characteristics of Bitwise Problems
    2. Defining the Problem Space
    3. Bitwise Operators
    4. Readability Aids
    5. Assigning Bit Values
    6. Writing Bitwise Functions
    7. Circular Shifts
    8. Character Information Array
    9. Direct Lookup
    10. Mapping With Bits
    11. Radix Sort
  • Chapter 4: Pointers
    1. Common Pointer Constructions
    2. Pointer Arithmetic
    3. Binary Search
    4. Command Line Arguments
    5. The Environment Pointer
    6. Changing a Pointer through a Function Call
    7. Processing Arrays With Pointers
    8. Simulation Example
    9. Simulating Higher Dimensional Arrays
    10. Two Dimensional Arrays
    11. Complex Declarations
    12. Pointers to Functions
    13. Surrogate Sorting: A Pointer Application
    14. Sorting with Large Records
  • Chapter 5: Designing Data Types: Structures
    1. Steps in Creating Data Types
    2. Rationale For a New Data Type
    3. The File fraction.h
    4. Operations on the Fraction Data Types
    5. Implementation of the Functions
    6. Example Program Using Fractions
    7. Applications with Fractions
    8. Set Notation Examples
    9. Creating the Set Type
    10. Set Representation Example
    11. Set Representation
    12. Set Function Implementations
    13. A Program Which Uses The Set Data Type
  • Chapter 6: Data Structures
    1. Potential List Elements
    2. Lists - What Are They?
    3. Problems With a List as an Array
    4. Lists as Arrays
    5. Benefits of Linking Elements
    6. A List of Linked Elements
    7. Defining the List Data Type
    8. The List Data Type
    9. Implementations of List Functions
    10. A Simple Program With a List
    11. Other Types of Lists
    12. The Need for Other Kinds of Lists
    13. Ordered Lists
    14. The rand Function
    15. Circular Lists
    16. Circular List Code
    17. Circular Lists Principles
    18. Two Way Lists - Example
    19. Two Way Lists
    20. Two Way List - print, order
    21. Two Way List - main
    22. Structures for Networks
    23. Networks
    24. Hashing is Close to Direct Lookup
    25. Hashing / Searching
    26. The Hashing Algorithm
    27. Hashing main Program
    28. Example Code For Linear Collision
    29. Linear Collision Handling
    30. The chain.h File
    31. Chaining Collision Handling
    32. Chaining - lookup Function
    33. Chaining Code - main
    34. Stacks
    35. Stack Representation
    36. Solving Problems With Stacks
    37. Picture of the Stack
    38. Push and Pop Functions
    39. The Calculator Driver Program
    40. Queues
    41. Queue Driver Program
    42. Binary Trees
    43. Traversing Trees
    44. tree.h
    45. Left-Root-Right Traversal
    46. Tree Algorithms
  • Chapter 7: Optimization Techniques
    1. Knowing When to Optimize
    2. Where to Optimize
    3. Examples of Macros
    4. Macros
    5. Knowing When to Initialize
    6. Initialization
    7. Modifying the Data Structure - Example
    8. Caching - Ready Access
    9. Invariant Expressions
    10. Logical Inefficiencies
    11. Odds and Ends Examples
    12. Odds and Ends
  • Chapter 8: Portability
    1. Different Kinds of Portability
    2. Source Code Portability
    3. Prototype Problems
    4. Portability with Functions
    5. Problems with ints
    6. Arithmetic Data Types
    7. Problems with Bits
    8. Bit Manipulation
    9. Portable Masks
    10. Pointer Problems
    11. ANSI vs. Non-ANSI Examples
    12. ANSI vs Non-ANSI
    13. Odds and Ends Examples
    14. Odds and Ends
  • Appendix A: Software Tools
    1. The cc Command
    2. Different C Compilers
    3. Options - Examples
    4. Compiler Options
    5. Conditional Compile Examples
    6. Conditional Compilation
    7. Positing Assertions
    8. The assert Macro
    9. Libraries
    10. Header File Support
    11. Libraries
    12. Graphics Coordinates
    13. A Graphics Example
    14. Examples of the Need for make
    15. The make Command
    16. An Example Makefile
    17. The make Dependency Tree
    18. SCCS Example
    19. Source Code Control System
    20. After a Revision Cycle
    21. Source Code Control System
  • Appendix B: Library Functions
    1. Building Command Strings
    2. system
    3. exit and atexit Examples
    4. exit and atexit
    5. signal
    6. Using strtok
    7. strtok
    8. memcpy and memset
    9. memcpy - memset
    10. Using qsort
    11. quicksort
    12. Binary Search Example
    13. bsearch
    14. strstr Example
    15. strstr
    16. strchr Example
    17. strchr, strrchr
    18. Data Validation Example
    19. strspn, strcspn
  • Appendix C: File Access
    1. I/O From Applications Programs
    2. System Calls vs. Library Calls
    3. The fopen Function
    4. Opening Disk Files
    5. Table of Access Modes
    6. Access Modes
    7. Reasons for an fopen Failure
    8. Errors In Opening Files
    9. Example: Copying a File
    10. I/O Library Calls
    11. Character vs Line Examples
    12. Character Input vs Line Input
    13. Interpreting Input
    14. Motivation for the scanf Function
    15. scanf Examples
    16. scanf
    17. sscanf Example
    18. scanf Variants
    19. fscanf and scanf Example
    20. scanf Variants
    21. sprintf and fprintf Examples
    22. printf Variants
    23. An fclose Example
    24. Closing Files - fclose
    25. Error Examples
    26. Servicing Errors - errno
    27. Servicing Errors - Example
    28. Servicing Errors - errno.h
    29. Application for Binary I/O
    30. Binary I/O
    31. The main Function - Code
    32. The main Function
    33. create_db Function - fwrite
    34. fwrite
    35. print_db Function - fread
    36. fread
    37. retrieve_db Function
    38. fseek
    39. fflush and ftell Example
    40. fflush and ftell
    41. Exercises