Skip to main content
pelatihan
.org
Learn. Practice. Grow.
Category
EN
Sign in
Sign up
Menu
C Curriculum: 12 Chapters, 72 Lessons — pelatihan.org
Home
/
Catalog
/
C
/
Curriculum
Curriculum
C Curriculum
Learn C online with 72 structured lessons, code examples, and 360 quiz questions.
72 lessons
12 chapters
360 questions
Summaries and key points are free to preview. Full lessons, code examples, and quizzes require a subscription.
01
C Tutorial
22 lessons
01
C HOME
This section becomes the gateway to C: from basic concepts of syntax, variables, data types, and controls of the flow, to advanced topics such as pointers, functions, files, and…
02
C Intro
C is a procedural programming language developed by Dennis Ritchie at Bell Labs around 1972. C is widely used to make operating systems (including Linux and Windows core),…
03
C Get Started
To start learning C, you need a compiler that converts the source code into a run-able program, like GCC, Clang, or MSVC. The C program is stored in a file extension .c and…
04
C Syntax
C syntax is a code-writing rule that must be followed for a program to be compiled. Each statement ends with a semicolon, the block of code is wrapped in curly braces, and the…
05
C Output
Output in C is performed with the printf function of the stdio.h header, which displays text or value to the screen (stdout). You can print plain text, numbers in %d format,…
06
C Comments
Commentary is a note in code that is ignored by the compiler, used to explain the content of the program for easy reading and maintenance. C supports two comment styles: one line…
07
C Variables
A variable is a named container for storing data that can change during the program's run. In C each variable must be declared by including its data type, e.g. int for integers…
08
C Data Types
The data type determines the type of value a variable can store and the size of the memory it uses. C provides built-in types such as int (integer), float and double (decimal),…
09
C Type Conversion
Type conversion is the process of converting one type of data into another type, either implicitly or explicitly by writing or casting. When the operator works with two different…
10
C Constants
A constant is a value that is set when a program is compiled and cannot be changed during the program's run. In C there are two main ways: declare the variable with the keyword…
11
C Operators
An operator is a symbol that commands a computer to perform a certain operation on a value, ranging from arithmetic (+, -, *, /, %), comparison (==,!=, >, <), to logic (&&,…
12
C Booleans
Boolean represents a true or false value, and in standard C no built-in bool type is provided. In general, the boolean value is represented by int, where 0 means wrong and a…
13
C If...Else
If and else branching allows the program to select the execution path based on certain conditions. The simple if form checks one condition, if...else provides two branches,…
14
C Switch
A switch is an efficient branching structure for comparing one value against many constant choices such as characters or numbers. Every possibility is written in a case, and…
15
C While Loop
While the loop runs the block code while the condition inside the cage is still valid. The condition is checked before each iteration, so if the initial condition is wrong then…
16
C For Loop
For loops are the most commonly used iteration structures when the number of iterations is known. The definition is divided into three parts within a line: the counter…
17
C Break/Continue
The break command removes the program from the repeat or switch once a certain condition is met, while continue jumps through the rest of the running iteration and straight to…
18
C Arrays
An array is a container for storing many values of the same type in one named variable, accessible via an index number starting at 0. The size of the array must be a constant…
19
C Strings
Strings in C are actually a set of characters stored in a char array, terminated implicitly by the character null worth '\0'. Since C does not have a dedicated operator for the…
20
C User Input
The program can receive input from the user through the scanf function of the stdio.h header, which reads data from the stdin according to the specifier format. For ordinary…
21
C Memory Address
Each variable in the program is stored in a specific memory location that has a unique hexadecimal address. In C the address of a variable can be obtained by adding the sign &…
22
C Pointers
A pointer is a special variable that stores memory addresses belonging to other variables, thus allowing indirect access to data. Pointers are declared with a * followed by the…
02
C Functions
9 lessons
01
C Functions
Function is a block of code named designed to perform a specific task and can be called many times from any part of a program. Using the function makes code more modular, easier…
02
C Function Parameters
A parameter is a variable declared on the signature of a function to receive a value from the caller, whereas an argument is the actual value sent when the function is called. C…
03
C Pass By Reference
C does not have the built-in call by reference mechanism as some other languages do, but the same effect can be achieved by passing a pointer-shaped memory address to the…
04
C Scope
Scope determines where a variable can be accessed in a program. Local variables are declared within a function or block {} and only live until the block is complete, whereas…
05
C Function Declaration
A declaration (prototipe) is a statement on a file that tells the compiler about the name of the function, the type of return, and the parameters without having to write the…
06
C Math Functions
The C mathematics library is provided with a header math.h containing functions such as sqrt (square root), pow (rank), ceil and floor (up/down clearance), and the M_PI constant…
07
C Inline Functions
Inline function is a function that is required to insert the code directly into the calling point instead of performing the usual function calling. In C this is expressed by the…
08
C Recursion
Recursion is a technique where a function calls itself to break up a problem into smaller subproblems. Each recursion must have a base case as a stop condition, otherwise the…
09
C Function Pointers
A pointer is a variable that stores the address of a function, so that the function can be stored in the variable, sent as an argument, or called indirectly. The declaration is…
03
C Files
3 lessons
01
C Create Files
Files in C are handled through a FILE-type pointer that comes from the stdio.h header. To open a file, use a fopen with the desired file name and mode, such as "r" for reading or…
02
C Write To Files
Writing files is done with the function fprintf (writing formatted text) or fputs after the file is opened with "w" or "a" mode. The "w" mode creates a new file or overlaps the…
03
C Read Files
Reading a file is done by opening it in "r" mode and then using fscanf to read formatted data or fgets to read a single line of text. EOF (end of file) marks no more readable…
04
C Structures
7 lessons
01
C Structures
Structure is a custom data type that combines several different variables of the type into one named container. Each part in it is called a member or field, and is accessed via a…
02
C Nested Structures
A nested structure is a structure that has members that are other structures, so that data can be organized in layers. The access is done in a sequence with a point, e.g.…
03
C Arrays of Structs
An array of struct is a collection of data of the same type that is stored side by side in memory, so it is suitable for data such as a list of students or a collection of…
04
C Structs & Pointers
Often struct is sent via pointer so that it is not necessary to copy the entire contents into the function's memory. To access the member through a pointer, an arrow operator is…
05
C Unions
Union keeps several members with different types in the same memory location, so only one member is active at a time. Because of memory sharing, the size of the union is equal to…
06
C typedef
Typedef creates a new alias for an existing type so that code is easier to read and more portable across platforms. The classic is used to shorten struct declarations, for…
07
C Struct Padding
The compiler inserts byte padding between the struct members so that each member is at an address that aligns with their needs. As a result the size of a struct is often greater…
05
C Enums
1 lessons
01
C Enums
Enumeration defines a set of constant values called number-based, so code is more readable than using a magic number without a name. The first member by default is 0 and the next…
06
C Memory
1 lessons
01
C Memory Management
C gives full control over memory: local variables live in the stack, whereas big data is allocated in the heap via malloc, calloc, realloc, and must be returned free. The classic…
07
C Errors
5 lessons
01
C Errors
Errors in C are grouped into compilation errors that stop the build process, runtime errors that occur when a program is running, and logic errors that make the result erroneous…
02
C Debugging
Debugging is the process of finding and fixing bugs systematically, not guessing the cause. Popular methods include using debuggers such as GDB with breakpoints, execution steps,…
03
C NULL
NULL is a special value that marks that a pointer does not point to any object, and the mere-dereference pointer NULL usually crashes the program. So before using a malloc result…
04
C Error Handling
C has no exception mechanism, so error handling is generally done through return values and global variables errno. Many standard functions send a failure marker such as NULL or…
05
C Input Validation
Input validation ensures that the input data is in line with the program's expectations from the type, range, and format side before further processing. User inputs are a source…
08
C More
8 lessons
01
C Date
The time.h header provides a time_t type to store time in seconds since the January 1, 1970 UTC epoch and struct tm for components such as years, months, and hours. The functions…
02
C Random Numbers
The rand() function produces random numbers of randomness between 0 and RAND_MAX, whereas srand() sets the generator's seed (seed) so that the order differs each time the program…
03
C Macros
Macro is a text substitution performed by a preprocessor before compilation and written with #define. A simple object macro such as #define PI 3.14159, whereas a function macro…
04
C Organize Code
The neat C project separates the code into many .c and .h files, where the header contains declarations such as prototypes, types, and constants, while the source file contains…
05
C Storage Classes
Storage class determines where a variable comes from, how long it lives, and how far it can be seen. C identifies auto as the default local variable, static for values that…
06
C Bitwise Operators
The bitwise operator works per bit AND (&), OR (depending), XOR (^ NOT (~), left slide (<<), and right slide (>>). This operator is useful for setting flags, saving memory with…
07
C Fixed-width Integers
The stdint.h header provides a type of integer with a fixed width such as int8_t, uint32_t, and int64_t, so its size does not depend on the platform. This is important when data…
08
C Command-Line Args
The play function can receive arguments from the command row through int main(int argc, char *argv[]), where argc is the number of arguments and argv is the array string of…
09
C DSA
9 lessons
01
C DSA Intro
Data structure is the way data is stored and organized, whereas algorithms are the steps of processing it; both work together to make a program faster and more memory-efficient.…
02
C Searching
The search is aimed at finding the position of a value within a data set. Linear search checks elements one by one and can be used on unordered data, whereas binary search…
03
C Sorting
The sequence composes data from the smallest to the largest value or vice versa so that it is easier to search and appear. Basic algorithms such as bubble sort, selection sort,…
04
C Stacks
A stack is a LIFO (last in, first out) data structure in which the last element entered through push is the first to exit through pop, similar to a plate stack. Its main…
05
C Queues
Queues are FIFO (first in, first out) data structures where the first element entering through the queue is the first to exit through the dequeue, like queues in a drawer. The…
06
C Linked Lists
Linked lists store data in nodes that are connected to each other via the next pointer, so that inserting and deleting in the middle is enough to break and connect the pointer…
07
C Trees
A tree is a hierarchical structure of branching nodes, where each node can have left and right children, and a node without children is called a leaf. The binary search tree…
08
C Hash Tables
The hash table stores key pairs and values by converting the key into an array index through a hash function, so that the average access takes place very quickly approaching…
09
C Big O
Big O Notation describes the worst growth in time or space of an algorithm as the size of the input increases, without affecting the speed of the computer. Common notations are…
10
C Projects
2 lessons
01
C Projects
A real project turns theory into a skill: start with a simple idea, break it down into small features, write the code modularly, then test it gradually. Good practices include…
02
C Problem Solving
Problem solving in C is the skill of breaking down big problems into small log steps before writing code. The flow is generally understanding the problem, crafting pseudocodes,…
11
C Examples
5 lessons
01
C Examples
The sample collection collects small programs that are often used as exercises, such as calculators, factorizations, and prime number checks. Reading and modifying examples is a…
02
C Real-Life Examples
Real-world examples show how C is used to solve everyday problems, such as shopping calculators, simple ticket systems, ATM PIN calculators, or value data processors. By modeling…
03
C Syllabus
The syllabus or curriculum maps the learning sequence of C from basic syntax and data types, branching, repetition, functions, arrays, strings, pointers, data structures, to…
04
C Study Plan
The learning plan makes learning progress C measurable by setting weekly goals, allocating daily practice time, and conducting periodic evaluations. The key is consistency, where…
05
C Interview Q&A
C-language interview questions typically test understanding of core concepts such as pointer and array differences, how malloc works, stack and heap differences, and the causes…