C Programming Language Tutorial: Procedural Middle-Level Computer Software System Programming Applications Games
C Programming Language Tutorial: Procedural Middle-Level Computer Software System Programming Applications Games
3
int main()
4
{
5
printf("Hello World!");
6
return 0;
7
}
Output
Hello World!
In this C tutorial, we’ll cover everything from basic syntax, data types,
and control structures to advanced topics like pointers, memory
management, and file handling. By the end, you’ll gain hands-on
experience and a solid understanding of C, which is essential for mastering
other programming languages like C++ and Java. Let’s dive into the world of
C programming and build a strong coding foundation!
C Overview
What is C Language?
C Features
C Standards
Setting Up C Development Environment
Hello World Program
Compiling a C Program: Behind the Scenes
C Basics
Tokens
Identifiers
Keywords
Comments
Variables
Constants
Data Types
Data Type Modifiers
Type Conversion
Operators
C Input/Output
Basic Input and Output
printf
scanf
Format Specifiers
Escape Sequence
C Operators
Arithmetic Operators
Unary Operators
Assignment Operators
Logical Operators
Bitwise Operator
Signed Number Representation
Operator Precedence and Associativity
C Flow Control
if Statement
if…else Statement
if-else-if Ladder
Switch Statement
Using Range in Switch Case
for Loop
while looping
do…while Loop
continue Statement
break Statement
goto Statement
C Functions
Introduction to Functions
User-Defined Function
Parameter Passing Techniques
Main Function
Inline Function
Nested Functions
C Arrays
Introduction to Arrays
Length of Array
Multidimensional Arrays
Pass Array to Functions
Pass a 2D Array as a Parameter
C Strings
Introduction to Strings
Length of String
String Comparison
String Copy
String Concatenation
Array of Strings
String Functions
C Pointers
Introduction to Pointers
Pointer Arithmetics
Pointer to Pointer (Double Pointer)
Function Pointer
Declare Function Pointer
Pointer to an Array
Constant Pointer
Pointer vs Array
Dangling, Void, Null and Wild Pointers
Near, Far and Huge Pointers
restrict Keyword
C Dynamic Memory Allocation
Memory Structure of a Program
Dynamic Memory Allocation (malloc(), calloc(), and free())
Memory Leak
C Structures and Union
Introduction to Structures
Array of Structures
Structure Pointer
Structure Member Alignment
Introduction to Unions
Bit Fields
Structure vs Union
Anonymous Union and Structure
Enumeration (or enum)
dot (.) Operator
typedef
C Storage Classes
Introduction to Storage Classes
extern Keyword
Static Variables
Initialization of Static Variables
Static Functions
Understanding “volatile” Qualifier
Understanding the “register” Keyword
C Preprocessor
Introduction to Preprocessors
Preprocessor Directives
How a Preprocessor Works?
Header Files
Header Files “stdio.h” vs “stdlib.h”
Write Your Own Header File
Macros and its Types
Interesting Facts About Macros and Preprocessors
# and ## Operators
Print a Variable Name
Multiline Macros
Variable Length Arguments for Macros
Branch Prediction Macros in GCC
typedef versus #define
Difference Between #define and const
C File Handling
Basics of File Handling
fopen() Function
EOF, getc() and feof()
fgets() and gets()
fseek() vs rewind()
Return Type of getchar(), fgetc() and getc()
Read/Write Structure From/to a File
Print Contents of File
Delete a File
Merge Contents of Two Files into a Third File
printf vs sprintf vs fprintf
getc() vs getchar() vs getch() vs getche()
C Error Handling
Error Handling
Using goto for Exception Handling
Error Handling During File Operations
Handle Divide By Zero and Multiple Exceptions
C Programs
Basic C Programs
Control Flow Programs
Pattern Printing Programs
Functions Programs
Arrays Programs
Strings Programs
Conversions Programs
Pointers Programs
Structures and Unions Programs
File I/O Programs
Date and Time Programs
More C Programs
Miscellaneous
Date and Time
Input-Output System Calls
Signals
Program Error Signals
Socket Programming
_Generics Keyword
Multithreading
C Interview Questions
Top 50 C Programming Interview Questions and Answers
Commonly Asked C Programming Interview Questions | Set 1
Commonly Asked C Programming Interview Questions | Set 2
Commonly Asked C Programming Interview Questions | Set 3