Introduction to C Programming | C Programming Fundamentals

Explore ANSI C Language, Emphasizing Portability, Structured Design & Best Practices

TTMFC2100

Introductory

5 Days

Course Overview

Introduction to C Programming / C Programming Fundamentals is a skills-focused, hands-on training course that provides students with a comprehensive introduction to the ANSI C language, emphasizing portability and structured design. Students are introduced to all major language elements including fundamental data types, flow control, and standard function libraries.

Throughout the course, students will thoroughly explore string and character manipulation, dynamic memory allocation, standard I/O, macro definition, and the C runtime library. The course explains the use of aggregate structures, unions, and pointers early on so the students can practice extensively in the hands-on labs. Structured programming constructs and varargs functions are also covered. Emphasis is given to the processing of command line arguments and environment variables so students will be able to write flexible, user-friendly programs. The course also includes coverage of portability tips drawn from experienced programmers working in production environments. Comprehensive hands on exercises are integrated throughout to reinforce learning and develop real competency.

Course Objectives

This ‘skills-centric’ course is about 50% hands-on lab and 50% lecture designed to train attendees in core C development skills, coupling the most current, effective techniques with the soundest coding practices. Students will explore a series of progressively advanced topics, where each topic consists of lecture, group discussion, practical hands-on lab exercises, and lab review.

Working within an engaging, hands-on learning environment, attendees will explore:

  • Components of a C program
  • Using the C preprocessor
  • Using standard runtime libraries
  • Using make to build programs
  • Working with debugger utilities
  • Using data types, storage classes and scope
  • Using typedef to make code more readable and portable
  • Using operators and expressions
  • Working with conditional and looping constructs
  • Initializing a pointer
  • Accessing the value addressed by a pointer
  • Returning the value of a function
  • Declaring argument data types
  • ANSI function prototype syntax
  • Declaring and initializing arrays and multidimensional arrays
  • Using Strings and character manipulation
  • Declaring and instancing a structure
  • Defining a union
  • Accessing command line arguments and environment variables
  • C runtime library standard I/O functions

Course Prerequisites

This is an introductory-level C programming course designed for attendees new to C, and new or newer to programming.  Attendees should be comfortable working with the command line and should have a good foundational mathematics or logic skills.

Course Agenda

  1. Overview of C
  • Operating System Independence
  • Design Goals and Capabilities
  • Flavors of C
  1. Compiler Directives and the C Preprocessor
  • Compile-Time Directives
  • Use of typedef
  • C Preprocessor Syntax
  1. Fundamental Data Types, Storage Classes, and Scope
  • Fundamental Data Types and Qualifiers
  • Constants and Strings
  • Storage Classes
  • Scope and Block Structure
  • Scope and Data Hiding
  • Data Initialization
  1. Pointers and Dynamic Allocation
  • Advantages of Pointers
  • User of Pointers
  • Pointer and Address Arithmetic
  • Dynamic Storage Allocation
  • sizeof Operator
  • Double Indirection
  1. Macros
  • Functions vs. Inlining
  • Purpose of Macros
  • Use of Macros
  • Making Code More Readable
  • Auto Adjustment of Compile Time Values
  • Conditional Compilation
  • Making Code Portable
  • Simplifying Complex Access Calculations
  • Advanced Micro Design Tips
  • Using Macros to Help Write Portable Programs
  • When to Use a Macro instead of a Function
  • Using Macros for Debugging
  1. Arrays
  • Purpose of Arrays
  • Declaring an Array
  • Initializing an Array
  • Addressing Elements
  • Stepping Through an Array
  • Variable Size Arrays
  • Arrays of Pointers
  • Arrays of Strings
  • Passing an Array to a Function
  • Dynamic Memory Allocation
  • Multidimensional Arrays
  1. Basic Formatted I/O
  • Standard I/O Library
  • Character Set Encoding
  • Standard Input and Output
  • Character I/O Functions
  • Formatted I/O Functions
  • String Constants
  1. Program Debugging
  • Problem Analysis
  • Instrumenting with printif
  • Instrumenting with ctrace
  • The Purpose of Debuggers
  • How Not to Use Debuggers
  • Symbolic Debuggers
  1. Operators and Expressions
  • Arithmetic, Logical, and Bit Operators
  • Precedence and Associativity
  • Assignment and Casting
  • The Conditional Operator
  1. Flow Control Constructs
  • Conditional Constructs: if, switch
  • Looping Constructs: while, do, for
  • Programming Style
  1. Functions (Subroutines)
  • Purpose of Functions
  • Functions vs. Inlining
  • Automatic Variables
  • The Argument Stack
  • Passing By Value
  • Passing By Reference
  • Declaring External Functions
  • Function Prototyping
  • ANSI Prototyping
  • The _NO_PROTO Compiler Symbol
  • Varargs Functions
  • Passing a Function as an Argument
  • Designing Functions for Reusability
  • Calling a Function from Another Language
  • Returning a Dynamically Allocated Value Using Double Indirection
  • Casting the Return Value of a Function
  • Recursion and Reentrancy
  1. Structures
  • Purpose of Structures
  • Defining and Declaring Structures
  • Accessing Members
  • Pointers to Structures
  • Dynamic Memory Allocation
  • Passing a Structure to a Function
  • As a Pointer
  • Passing the Actual Structure
  1. Advanced Structures and Unions
  • Nested Structures
  • Arrays of Structures
  • Bit Fields
  • Unions
  • Linked Lists
  1. C Runtime Library Standard Functions
  • Character I/O
  • Unformatted File I/O
  • Formatted File I/O
  • Math Functions
  • Miscellaneous Functions
  1. Strings and Character Manipulation
  • Strings as Character Arrays
  • String Library Functions
  • Reading and Writing Strings
  1. Accessing Command Line Arguments and Environment Symbols
  • argc and argv
  • Parsing Command Line Options
  • Accessing the Environment Array
  1. Structured Programming
  • Structuring Code for Quality, Reliability, Maintainability
  • Designing for Modularity and Reusability
  1. Advanced Programming Consideration
  • Writing Portable Code
  • Use of Macros
  • ANSI C Limits
  • Feature Test Macros
  • Client/Server Design
  • Performance Considerations

Course Materials

Student Materials: Each student will receive a Student Guide with course notes, code samples, software tutorials, diagrams and related reference materials and links (as applicable). Our courses also include step by step hands-on lab instructions and and solutions, clearly illustrated for users to complete hands-on work in class, and to revisit to review or refresh skills at any time. Students will also receive the project files (or code, if applicable) and solutions required for the hands-on work.

Classroom Setup Made Simple:  Our dedicated tech team will work with you to ensure your classroom and lab environment is setup, tested and ready to go well in advance of the course delivery date, ensuring a smooth start to class and seamless hands-on experience for your students. We offer several flexible student machine setup options including guided manual set up for simple installation directly on student machines, or cloud based / remote hosted lab solutions where students can log in to a complete separate lab environment minus any installations, or we can supply complete turn-key, pre-loaded equipment to bring ready-to-go student machines to your facility.  Please inquire for details.

Raise the bar for advancing technology skills

Attend a Class!

Live scheduled classes are listed below or browse our full course catalog anytime

Special Offers

We regulary offer discounts for individuals, groups and corporate teams. Contact us

Custom Team Training

Check out custom training solutions planned around your unique needs and skills.

EveryCourse Extras

Exclusive materials, ongoing support and a free live course refresh with every class.

Mix, Match & Master!
2FOR1: Two Courses, One Price!

Enroll in *any* two public courses (for 2023 *OR* 2024 dates!) by December 31, for one price!  Learn something new, or share the promo!

Click for Details & Additional Offers

Learn. Explore. Advance!

Extend your training investment! Recorded sessions, free re-sits and after course support included with Every Course
Trivera MiniCamps
Gain the skills you need with less time in the classroom with our short course, live-online hands-on events
Trivera QuickSkills: Free Courses and Webinars
Training on us! Keep your skills current with free live events, courses & webinars
Trivera AfterCourse: Coaching and Support
Expert level after-training support to help organizations put new training skills into practice on the job

The voices of our customers speak volumes

Special Offers
Limited Offer for most courses.

SAVE 50%

Learn More