Duration
3 days
Overview
C is the most commonly used programming language for writing operating systems. The first operating system written in C is Unix. Later operating systems like GNU/Linux were all written in C. C is also the precursor and inspiration for almost all of the most popular high-level languages available today. In fact, Perl, PHP, Python and Ruby were all written in C, because the primary design of C is to produce portable code while maintaining performance and minimizing footprint (CPU time, memory usage, disk I/O, etc.). This is useful for operating systems, embedded systems or other programs where performance matters a lot (“high-level” interface would affect performance).
C is reasonably close to assembly machine. It support features like pointers, bytes and bit level manipulation. C allows the programmer to write directly to memory. C structures, pointers and arrays are designed to structure and manipulate memory in an efficient, machine-independent fashion. It is generally used to create hardware devices, OS, drivers and kernels. Introduction to C programming is designed for anyone who wants to become a polygot programmer, which requires understanding programming at a deeper level. Learning the C language will increase the participants programming skills. C is one of the most widely used computer language among the modern software programmers.
Objective
This course familiarizes the participants with the ins and outs of C programming language.
- Components of a C program
- Using the C pre-processor
- Using standard runtime libraries
- Using make to build programs
- Working with debugger utilities
- Using data types and scope
- Using typedef to make code more readable and portable
- Using operators and expressions
- Working with conditional and looping constructs
- Initializing a pointer and 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
- Accessing command line arguments and environment variables
- C runtime library standard I/O functions
Prerequisites
Participant must have a basic understanding of Computer Programming terminologies. A basic understanding of any of the programming languages will help in understanding the C programming concepts and move fast on the learning track.
Target Audience
This course is designed for software programmers with a need to understand the C programming language starting from scratch. This course will give participants enough understanding on C programming language from beginner to higher level of expertise.
Day 1
- Overview of C Language
- Facts about C
- Why use C
- Environment Setup
- Program Structure
- Hello world program
- Compile and Execute the program
- Basic Syntax
- Tokens in C
- Semicolons
- Comments
- Identifiers
- Keywords
- White space in C
- Data Types
- Basic, Enumerate and Derived Types
- Integer Types
- Floating-Point Types
- The void Type
- Variables
- Constants
- Lvalues and Rvalues in C
- Storage Classes
- The auto storage class
- The register storage class
- The static storage class
- The extern storage class
- The const variables
- The volatile variables
- Operators
- Arithmetic Operators
- Relational Operators
- Logical Operators
- Bitwise Operators
- Assignment Operators
- Miscellaneous Operators
- Decision Making
- The if statement
- The if…else statement
- The nested if statements
- The switch statement
- The nested switch statement
- The ? : Operator
- Loops
- While Loop
- For loop
- Do…while loop
- Nested loops
- Continue, break statements
- Jump statements
- Functions
- Defining a Function
- Function Declarations
- Calling a Function
- Function Arguments
- Pass by value
- Pass by reference
- Recursion
- Variable Arguments
Day 2
- Pre-processors
- The #define
- The #include
- The #undef
- The #ifdef
- The #else
- The #endif
- The #ifndef
- The #pragma
- The typedef
- Scope Rules
- Local Variables
- Global Variables
- Formal Parameters
- Initializing Local and Global Variables
- Arrays
Introduction
- Declaring Arrays
- Initializing Arrays
- Accessing Array Elements
- Multidimensional Arrays
- Passing arrays to function
- Return array from function
- Pointers
- What are pointers
- How to use pointers
- Null Pointers
- Pointer arithmetic
- Array of pointers
- Pointer to pointer
- Passing pointers to functions in C
- Return pointer from functions in C
- Pointer to an array
- Strings
- strcpy
- strcat
- strlen
- strcmp
- strchr
- strstr
- String to Integer Conversion
- Two dimensional array of strings
- C Structures & Union
- Defining a Structure
- Accessing Structure Members
- Structures as Function Arguments
- Pointers to Structures
- Defining a Union
- Accessing Union Members
- Bit Fields
- Bit Fields Declaration
Day 3
- Sorting techniques
- Selection
- Bubble
- Insertion
- C Input and Output
- Standard Files
- getchar() and putchar()
- gets() and puts()
- scanf() and printf()
- Format Specifiers
- File I/O
- Opening Files
- Closing Files
- Writing a FIle
- Reading a File
- Random Access
- Binary I/O Functions
- Other functions
- C Header Files
- Include Syntax
- Include Operation
- Once Only Headers
- Computed Includes
- Type Casting
- Integer Promotion
- Usual Arithmetic Conversion
- Error Handling
- errno()
- perror()
- strerror()
- Divide by Zero Errors
- Program Exit Status
- Memory Management
- Allocating Memory Dynamically
- Resizing Memory
- Releasing Memory
- BIT Fiddling
- Binary numbers, bits and bytes
- Other number bases
- C’s bitwise operators
- Command Line Arguments
Programme scope, delivery arrangements and suitability are confirmed during enquiry.