Start Date: 08/03/2022

Price 6,229 ILS

DURATION 3 Days

Course Overview

This advanced hand-on course in C gives the participant the tools needed to program more efficiently and more robustly. The course includes advanced C topics such as: pointers, pre-processor directives, program organization and design and libraries.  A “must” for the C programmer.

Who should attend?

C programmers.

Prerequisite:

Programming in C.

Course Outline:

1. Introduction
• The place of the C language
• Why advanced C

2. Pointers
• Pointer Variables
• The Address and Indirection Operators
• Pointer Assignment
• Pointers as Arguments
• Using const to Protect Arguments
• Pointers as Return Values

3. Pointers and Arrays
• Pointer Arithmetic
• Pointers to Compound Literals
• Using Pointers for Array Processing
• Combining the * and ++ Operators
• Using an Array Name as a Pointer
• Using a Pointer as an Array Name
• Pointers and Multidimensional Arrays
• Pointers and Variable-Length Arrays

4. Strings
• String Literals

– Escape Sequences in String Literals
– Continuing a String Literal
– How String Literals Are Stored
– Operations on String Literals
– String Literals and Character Constants

• String Variables

– Initializing a String Variable
– Character Arrays and Pointers

• Reading and Writing Strings
• Accessing the Characters in a String
• Using the C String Library
• Arrays of Strings
• Command-Line Arguments

5. Advanced Pointer Use
• Dynamic Storage Allocation
• Dynamically Allocated Strings
• Dynamically Allocated Arrays
• Deallocating Storage
• Linked Lists

– Node Type
– The -> Operator
– Inserting, Searching, Deleting
– Ordered Lists

• Pointers to Pointers
• Pointers to Functions
• Function Pointers as Arguments

6. The Preprocessor
• How the Preprocessor Works
• Preprocessing Directives
• Macro Definitions

– Simple and parameterized macros
– The #  and ## Operators
– General macro properties
– Using parentheses
– Creating Longer Macros
– Predefined Macros
– Macro Arguments
– The __func__ Identifier

• Conditional Compilation

– Conditional directives
– The defined Operator
– Uses of conditional compilation

• Miscellaneous Directives

– #error, #line, #pragma,
– _Pragma Operator
7. Program Organization
• Local and static local variables
• Parameters
• External Variables
• Blocks
• Scope
• Organizing a C Program

 

8. Writing Large Programs
• Source files
• Header files

– #include
– Sharing
– Protecting header files
– #error in header files

• Dividing a program into files
• Building a multi-file program
• Defining macros outside a program

9. Program Design
• Modules

– Cohesion and Coupling
– Types of Modules

• Information Hiding
• Abstract Data Types
• Design Issues for Abstract Data Types
– Naming Conventions

– Error Handling
– Generic ADTs

10. Input/Output
• Streams

– File pointers
– Standard streams and redirection
– Text and binary files

• File Operations

– Major file operations
– File names from the command line
– Temporary files
– File buffering
– Miscellaneous file operations

• Formatted I/O

– printf
– scanf
– End-of-file and error conditions

• Character I/O
• Line I/O
• Block I/O
• File Positioning
• String I/O

11. The Standard Library
• Using the library
• C89 library overview
• C99 library changes
• <stddef.h> header
• <stdbool.h> header (C99)

12. Library Support for Numbers and Character Data
• <float.h>
• <limits.h>
• <math.h> – C89 and C99
• <ctype.h>
• <string.h>
• Error Handling
• <assert.h>
• <signal.h>

13. Miscellaneous Library Functions
• <stdarg.h>

– Functions with a variable argument list
– v…printf functions
– v…scanf functions

• <stdlib.h>
• <time.h>

14. Summary