| # | Topic | Description | Example |
|---|---|---|---|
| 1 | Data Types | The different types of data that can be used in C. | int, float, char, double, void |
| 2 | Data Types - int | Used to declare integer variables. | int x = 10; |
| 3 | Data Types - float | Used to declare floating-point variables. | float y = 3.14; |
| 4 | Data Types - char | Used to declare character variables. | char c = 'a'; |
| 5 | Data Types - double | Used to declare double-precision floating-point variables. | double d = 1.2345; |
| 6 | Data Types - void | Used to indicate that a function does not return a value. | void print_hello(void) { printf("Hello, world!\n"); } |
| 7 | Variables | The concept of variables and how they are used in C. | int num = 42; |
| 8 | Variables - declare | Variables must be declared before they can be used. | int x; x = 10; |
| 9 | Variables - init | Variables can be initialized when they are declared. | int y = 20; |
| 10 | Variables - assign | Variables can be assigned new values at any time. | num = 100; |
| 11 | Operators | The mathematical and logical operators used in C. | +, -, *, /, %, <, >, ==, !=, &&, ` |
| 12 | Operators - math | Arithmetic operators (+, -, *, /, %) perform basic math operations. | int sum = 5 + 7; |
| 13 | Operators - cmp | Comparison operators (<, >, ==, !=) compare two values and return a boolean result. | if (x < y) { /* do something */ } |
| 14 | Operators - logic | Logical operators (&&, ` | if (x > 0 && y < 10) { /* do something */ } |
| 15 | Control Structures | The structures used to control the flow of a program. | if, else, while, for, switch, break, continue |
| 16 | Control Structures - if | The if statement allows a program to make decisions based on a condition. | if (x > 10) { /* do something */ } |
| 17 | Control Structures - while | The while loop allows a program to repeat a set of statements while a condition is true. | while (x < 100) { /* do something */ } |
| 18 | Control Structures - for | The for loop allows a program to repeat a set of statements a fixed number of times. | for (int i = 0; i < 10; i++) { /* do something */ } |
| 19 | Control Structures - switch | The switch statement allows a program to select from multiple alternatives based on a value. | switch (x) { case 1: /* do something */ break; case 2: /* do something else */ break; default: /* do something if none of the cases match */ } |
| 20 | Arrays | The concept of arrays and how they are used in C. | int arr[5] = {1, 2, 3, 4, 5}; |
| 21 | Arrays - declare | An array is a collection of variables of the same type. | int arr[3] = {10, 20, 30}; |
| 22 | Arrays - access | The elements of an array can be accessed using an index. | int x = arr[1]; // x is now 20 |
| 23 | Arrays - index | Arrays in C are zero-indexed, meaning the first element has an index of 0. | int y = arr[0]; // y is now 1 |
| 24 | Functions | The concept of functions and how they are used in C. | int add(int x, int y) { return x + y; } |
| 25 | Functions - call | A function is a block of code that performs a specific task. | int sum = add(5, 7); // sum is now 12 |
| 26 | Functions - param | Functions can accept parameters, which are values passed to the function when it is called. | int product = multiply(3, 4); // product is now 12 (assuming there's a multiply function defined elsewhere) |
| 27 | Functions - return | Functions can also return a value to the calling code. | int max = find_max(3, 7, 1); // max is now 7 |
| 28 | Pointers | The concept of pointers and how they are used in C. | int *ptr = &x; |
| 29 | Pointers - declare | A pointer is a variable that stores the memory address of another variable. | int *ptr; |
| 30 | Pointers - access | Pointers can be used to access the value of the variable they point to. | int y = *ptr; // y is now the value of x |
| 31 | Pointers - access | Pointers can be used to access the value of the variable they point to. | int y = *ptr; // y is now the value of x |
| 32 | Pointers - modify | Pointers can also be used to modify the value of the variable they point to. | *ptr = 20; // x is now 20 |
| 33 | Memory Management | The way memory is allocated and managed in C. | malloc, free, realloc |
| 34 | Dynamic Memory Allocation | Memory can be allocated dynamically during program execution using malloc and realloc. | int *arr = malloc(10 * sizeof(int)); |
| 35 | Freeing Memory | Dynamically allocated memory must be freed using free when it is no longer needed. | free(arr); |
| 36 | Structures | The concept of structures and how they are used in C. | struct person { char name[50]; int age; }; |
| 37 | Structures - declare | A structure is a user-defined data type that contains a collection of named variables of different types. | struct person p1; |
| 38 | Structures - access | The variables in a structure can be accessed using the . operator. | p1.age = 30; |
| 39 | Structures - typedef | A structure can be given a new name using typedef. | typedef struct person Person; |
| 40 | File Input/Output | Reading from and writing to files in C. | fopen, fclose, fread, fwrite |
| 41 | Reading from a File | A file can be opened for reading using fopen and read using fread. | FILE *fp = fopen("input.txt", "r"); |
| 42 | Writing to a File | A file can be opened for writing using fopen and written to using fwrite. | FILE *fp = fopen("output.txt", "w"); |