🎓 A1Learner
🔍
0 of 50 lessons completed

Home / C

C

C from a first program to two finished projects: output and variables, decisions and loops, arrays and strings, functions, pointers and memory, structs and files. Every example is compiled and run with the real gcc compiler.

C is the language that sits closest to the machine while staying small enough to hold in your head. Fifty short lessons take you from a first program to two finished projects, with every example compiled and run for real.

Start learning ❯❯50 lessons · 12 topics · 0/50 completed

Course contents

Work top to bottom — the sidebar is the course. Topics later in the list assume the ones before them.

Getting Started

Start: C Introduction ❯

Variables and Types

Start: C Variables ❯

Decisions

Start: C If Else ❯

Loops

Start: C While Loop ❯

Arrays and Strings

Start: C Arrays ❯

User Input

Start: C User Input ❯

Functions

Start: C Functions ❯

Pointers and Memory

Start: C Memory Address ❯

Structures

Start: C Structures ❯

Files

Start: C Create Files ❯

More C

Start: C Math Functions ❯

Projects

Start: C Project: Number Guessing Game ❯

Learn C

C is a language you compile before you run. You write source code, a compiler turns it into machine instructions for the computer to run. Because the translation happens ahead of time, finished programs run fast and need little else to run.

Its long life is part of its value. Operating systems, embedded devices, and game engines are still written in C, and the ideas it teaches — memory, addresses, and the cost of every choice — carry into every other language. Learning C first makes the next language easier, whichever one it is.

Fifty lessons spread over twelve groups carry the teaching. Output, variables, and types open the course, then decisions, loops, arrays, and strings. User input follows, before functions, pointers, and memory. Structures, files, and a short tour of the wider language finish the main run, capped by a guessing game and a calculator.

What you will learn

Here is the full run of 50 lessons, in teaching order:

  • Print words and numbers from a small program
  • Keep values in typed variables and named constants
  • Convert between types on purpose instead of by accident
  • Branch with if statements, switch blocks, and the ternary operator
  • Repeat work using while, do while, and for loops
  • Hold rows of values in arrays, and text in char arrays
  • Read numbers and words from the keyboard with scanf
  • Split behaviour across functions, with parameters and return values
  • Read values through pointers that hold addresses
  • Ask for memory while a program runs, and give it back with free
  • Bundle related values in structs, and name types with typedef and enum
  • Create files, write lines into them, and read them back
  • Use maths functions, macros, storage classes, and bitwise operators
  • Assemble a number guessing game and a simple calculator

Who this C course is for

No earlier coding is assumed here. The first lessons show what a program is, before you write one yourself, and every new term arrives inside the example that needs it. Steady practice matters more than maths.

Lesson time adds up to four hours and thirty-five minutes. Most readers slow down in the pointer lessons, which is normal. A second read of those lessons pays off more than anywhere else in the set.

Students heading toward computer science classes will find the first lessons familiar. Hobbyists curious about how computers really work get the grounding those machines expect. Readers coming from a scripting language meet the stricter rules spelled out rather than assumed.

How this course works

Compiler errors are treated as part of the lesson, not a failure. When a sample is meant to fail, you see the compiler's own words beside it. Programs that run show exactly what they printed when built here, on gcc with warnings turned up.

Every lesson ends with a working program and one question to check the idea. The order is fixed because pointers make little sense before functions land, and functions make little sense before loops land. Your place is saved in this browser on the device you used, with no sign-up and no charge for any lesson.

Frequently asked questions

Does this course teach C or C++?

C is its own language, smaller and older than C++. This course teaches C only. The next step after it is the C++ beginner course, which builds on the same ideas.

What do I need installed to start?

Nothing beyond a text editor and gcc. The second lesson walks through installing gcc and compiling a first program. The examples show the exact commands, so nothing is left to guess.

How much time does the course take?

Fifty lessons totalling four hours and thirty-five minutes, so a bit over four and a half hours of core material. Working through the examples yourself takes about twice as long. The two projects at the end are included in that count.

What is the hardest part of C?

Pointers and memory ask the most of a beginner, which is why this course holds them until functions and loops feel familiar. The scanf traps get a whole lesson of their own, since a missing & is the most common first failure.

What will I be able to build afterwards?

Small command-line programs come first: calculators, guessing games, file tools, and simple record keepers. The closing projects build a guessing game from loops and input, and a calculator from switch and functions. Bigger systems need the intermediate course and a lot more practice.

Does the course cost anything?

No, all fifty lessons are open without payment. There is no account to create. The site keeps your place on the device you used, with no account at all.

Next steps

  • C++ Beginner ❯ — The direct sequel: 40 lessons that build on C with classes, templates, and the standard library.
  • Python Beginner ❯ — A gentler second language in 116 lessons, for readers who want to compare C with a scripting language.
  • Rust Beginner ❯ — A modern systems language taught from scratch in 142 lessons, with memory safety enforced by the compiler.