C Training – Advanced C Programming Course

Title
SF001 – C Training – Advanced C Programming Course

Course Overview

Advanced C Programming Training

Advanced C programming course skims through the basics of C and soon jumps over to the core of C programming language which looks simple but is difficult to master. Our C Training will make the participant learn deep C secrets and develop a fairly advanced level of C programming expertise which is essential to write complex mission-critical systems and application software.

Course Highlight

  • Advanced C Programming course will be delivered by our Founder/Director who is an Expert with 20+ years of experience in Linux Kernel and SAN software development. The C training flow will be an assignment-driven model so that participants can develop expert-level C programming skills.
  • Participants will be writing lots of C programs dealing with operator precedence, conditional constructs, strings, pointers, arrays, arrays & pointers, double pointers, function pointers, pointers to arrays, internal storage for various data types, creating in-memory data structures, bit-field operators, recursions, function call, and stack formation, standard file I/O library, buffered IO, etc.

Course Delivery

  • Lectures, Classroom Discussions and C Programming Lab Exercises
  • 30% Theory, 70% Lab
  • Location: Sanfoundry Institute, Bangalore, India

Pre-Requisites
Basic knowledge of C with a deep desire to learn C programming in depth.

Target Audience
IT Professionals and/or Students who want to become serious Developers.
Experienced professionals preparing for Technical C-Round Interviews in Top IT Product MNCs.
advertisement
advertisement

Fee, Schedule & Registration
Click Here
for Advanced C Programming course training schedule, fee, and registration information or if you are interested in Classroom training @ Bangalore.
Click Here if you are a Foreign National, Overseas Participant or an NRI for Online Training.

Advanced C Training Course Outline

The C Language
C Program Compilation
Execution Process
Tokens of C Program
C Instructions
Constants, Variables
Identifiers and Keywords
Primitive Data Types
Structures – The Definition
Structures – Declaration & Type
Accessing Elements of Structure
Range of Signed/Unsigned Data-types
Efficient way of Printing Pointer
Compiler Memory Allocation for Data-types
Compiler Memory Allocation for Structures
Data-type Alignments
Compiler Memory Allocation for Unions
Union – Data Corruption
Practical Usage of Unions
Practical Usage of Bitfields
Bitfields Overflow
Printing every byte of an Integer
Enumeration
Typedef Statements
Practical example of Typedef Usage
typedef’ing a Function Pointer
Bit-Fields in Structure
Practical examples of Bitfield Usage
Structure Padding & Pitfalls
Programming Model & Memory Sizes
Why Sizeof Int and Long is 4 or 8?
Use of long long in 32-bit Architecture
Practical Example of long long
IA-32, IA-64, ILP-32, LP64, x86-64
Array – Representation
Array – Memory Allocation
Array – Declaration & Initialization
Two Dimensional Arrays
Pointers
Accessing a Variable Through Pointer
Pointer – Memory Allocation
Pointer – Declaration & Initialization
Pointer – Dereferencing
Pointers & Arrays
Character Arrays using Pointers
Array of Character Pointers
Memory Diagram – Array of Char Pointers
Arrays as Pointers – a[i] == i[a]?
Constant Pointers
Pointer Arithmetic
String Handling Functions
String Conversion Functions
Efficient usage of sscanf()/sprintf()
Computing Basic
Binary & Octal Systems
Decimal & Hexadecimal Systems
Signed Representations in Memory
Binary Shifts – Right & Left
Sign Bits and Bit-Shift Operations
Right Shift – Logical Vs Arithmetic Shift
Bit-Shift Overflow
ASCII Representations
Endian-ness – Little Vs Big
Endian-ness – Portability Issues

Operators
Bitwise Operations
Logical Operators – Short Circuit
Bitwise Vs Logical Operations
sizeof() operator
Pitfalls/Issues with sizeof() usage
Pointer Increment & Scaling
Operator Precedence
Operator Associativity
True meaning of Associativity
Examples of Precedence & Associativity
Ternary Operator Associativity Rule
Data-type Conversion Rules
Float to Int to Float Conversions
Variadic functions & default promotion rules
Printf Idiosynchracies
Pointer Format Specifiers
Signed Vs Unsigned – Pitfalls
Evaluation of i = ++i + ++i
Evaluation of i = ++i + ++i + ++i
Concept of Sequence Points
Example of Sequence Points
Storage Classes
Storage Class Specifiers
Scope of a Variable
Register, Auto, Static, Extern
Why Register Class and Practical Examples
Automatic Variables and Stack
Static Variables and Functions
True meaning of Extern
How to Use extern across Multiple Files with Examples
Best Practices for Extern Usage
Local/Block/Global Scope
Nesting of Scope
Lifetime of a Variable
Linkage of a Variable
What is Const?
Practical Examples of Const Qualifier
Usage of Constant in library functions (libc)
What is Volatile?
Practical Examples of Volatile Qualifier
Const Volatile Together?
Register Vs Volatile Performance?
Practical Examples of Const Volatile
Pointer Aliasing
What is Restrict Qualifier?
Restrict Keyword and Compiler Optimization
Examples of Restrict Qualifier
Memory
Dynamic Memory Allocations
malloc, calloc, realloc, free
malloc Vs calloc
Heap Memory
Stack Memory – Pitfalls
Dangling Pointers
DMA – Errors
Best Practices for malloc() & free()
DMA – Unspecified Behaviour
Functions & Pointers
Invoking Functions
Passing Arguments to Functions
Call by Value & Reference
Is C call by Value?
Is C call by Reference?
Array as Function Argument
Rules for Array Argument Passing
Multi-dimensional Array Argument Passing
Structure as Function Argument
Function Pointers
Declaration and Usage of Function Pointers
Function Pointers as Function Parameters
Practical Example of Function Pointers
Pointer to an Integer Array
C Pointers Complexity Chart
int *p
int *p[] int **p
int **p[] int (*p)()
int (*p)[] int *p()
int *(*p[])()
int *(**p)[]
Static Vs Dynamic Runtime Environment
Function Call and Runtime Stack
Rules for Evaluation of Function Arguments
Memory Organization
Code Segment
Data Segment
Heap Segment
Stack Segment
free space
register space
Stack Frames
Calling Sequence
View of Runtime Stack with Example
Access to Local Variable in Stack
Local Temporaries
Preprocessor
Preprocessor – #include statements
Multiple Inclusion of a Header File?
Preprocessor – #define statements
Preprocessor – Conditional Compilation
Preprocessor – Nested Macros
Preprocessor – Multiline Macros
Preprocessor – Stringizer
Preprocessor – Token Concatenation
Preprocessor – Useful Directives
Conditional Directives for Debugging
Where Macros are Heavily Used
Practical Examples of Macros
Macros Pitfalls
Macros Vs Enums
Inline Functions
Macros Vs Inline
Inline Recursive Functions
Standard I/O Library
Files & Streams
Streams Buffers
IO Buffers – Line Vs Full Vs No-Buffers
Setting & Flushing Buffers
File Access
File Access Modes
Sequential Vs Random Access
Concept of File Offsets
File Operation Errors
End-of-File Condition?
Return Values and Error Values
Character Based File I/O
Line Based File I/O
Formatted File I/O
Block File I/O
Dangerous – gets() Vs fgets()
File Random Access Methods
Command Line Argument
Environment Variables in C Programs
Recursion Example
Recursion Vs Iteration
Code/Space/Time Complexity

Sample C Assignments for Discussion/Memory-Diagram/Labs in Advanced C-Class

1. Comment on the output of following code:

  1.     #include <stdio.h>
  2.     main()
  3.     {
  4.         char *p = 0;
  5.         *p = 'a';
  6.         printf("value in pointer p is %c\n", *p);
  7.     }

a) It will print a
b) It will print 0
c) Compile time error
d) Run time error
View Answer

Answer:d
Output:
$ cc pgm.c
$ a.out
Segmentation fault (core dumped)

2. What is the output of this C code?

  1.    #include <stdio.h>
  2.    main()
  3.    {
  4.        if (sizeof(int) > -1)
  5.            printf("True");
  6.        else
  7.            printf("False");
  8.    }

a) True
b) False
View Answer

Answer:b
Output:
$ cc pgm.c
$ a.out
False
advertisement

3. What is the output of this C code?

  1.     #include <stdio.h>
  2.     main()
  3.     {
  4.         char *p = "Sanfoundry C-Test";
  5.         p[0] = 'a';
  6.         p[1] = 'b';
  7.         printf("%s", p);
  8.     }

a) abnfoundry C-Test
b) Sanfoundry C-Test
c) Compile time error
d) Run time error
View Answer

Answer:d
Output:
$ cc pgm.c
$ a.out
Segmentation fault (core dumped)

4. What is the output of this C code?

  1.     #include <stdio.h>
  2.     int main()
  3.     {
  4.         float f = 0.1;
  5.         if (f == 0.1)
  6.             printf("True");
  7.         else
  8.             printf("False");
  9.     }

a) True
b) False
View Answer

Answer: b
Output:
$ cc pgm.c
$ a.out
False
advertisement

5. What is the output of this C code?

  1.     #include <stdio.h>
  2.     main()
  3.     {
  4.         int n = 0, m = 0;
  5.         if (n > 0)
  6.             if (m > 0)
  7.                 printf("True");
  8.         else 
  9.             printf("False");
  10.     }

a) True
b) False
c) No Output will be printed
d) Run Time Error
View Answer

Answer:c
Output:
$ cc pgm.c
$ a.out
$

Fee, Schedule & Registration
Click Here
for Advanced C Programming course training schedule, fee and registration information

advertisement
advertisement
Subscribe to our Newsletters (Subject-wise). Participate in the Sanfoundry Certification contest to get free Certificate of Merit. Join our social networks below and stay updated with latest contests, videos, internships and jobs!

Youtube | Telegram | LinkedIn | Instagram | Facebook | Twitter | Pinterest
Manish Bhojasia - Founder & CTO at Sanfoundry
Manish Bhojasia, a technology veteran with 20+ years @ Cisco & Wipro, is Founder and CTO at Sanfoundry. He lives in Bangalore, and focuses on development of Linux Kernel, SAN Technologies, Advanced C, Data Structures & Alogrithms. Stay connected with him at LinkedIn.

Subscribe to his free Masterclasses at Youtube & discussions at Telegram SanfoundryClasses.