TeqStudy Β· C++ Track

Before You Code β€” C++ Pre-Course

For someone whose only tech experience is using a computer. No syntax yet β€” just what a program actually is, and getting your machine ready to write real C++. Zero assumed knowledge, genuinely.

πŸ’» βš™οΈ πŸ–₯️ πŸ”§ βœ…
Phase 1: C++ Fundamentals β†’
Course Progress
0%
LESSON 1 Β· THE BIG IDEAS

πŸ“œ What a Program Actually Is

Before you write a single line of C++, let's make sure you understand what a program even is β€” not technically, just in plain human terms. Everything else in this entire course builds on this one idea.

🎯 The One-Sentence Definition

A program is a list of instructions that a computer follows, one at a time, in order. That's genuinely it. There's no magic happening inside the machine. The computer does exactly what you tell it β€” no more, no less. If something goes wrong, it's because an instruction was wrong or missing, not because the computer "misunderstood" you.

🍳 A Recipe Is a Program

A recipe tells you: get two eggs, crack them into a bowl, add salt, whisk, pour into a hot pan, wait two minutes, flip. The steps are in a specific order. Each step depends on the one before it. If you skip "crack the eggs," step 4 ("whisk") doesn't make sense anymore.

A C++ program is the exact same idea, just written in a language a computer can follow instead of a language a person can follow. Every program you'll ever write β€” from a simple calculator to a video game β€” is fundamentally just a very long, very precise recipe.

πŸ–₯️ You Already Know How to Use a Computer β€” Here's the New Part

You already know how to click icons, open apps, save files, and use a web browser. Using software and writing software feel like completely different worlds, but the gap is smaller than it looks. When you use an app, someone else already wrote its "recipe" β€” you're just following the finished result. This course teaches you to write the recipe yourself.

🧱 The Small Number of Building Blocks

Here's something genuinely reassuring: every program ever written β€” no matter how complex β€” is built from a small handful of basic ideas, combined in different ways. This entire "Big Ideas" section covers all of them, in plain English, before you see a single line of actual C++:

πŸ“¦

Storing Information

Remembering a value to use later

πŸ”€

Making Decisions

Doing different things depending on a condition

πŸ”

Repeating Things

Doing the same step multiple times without retyping it

🏷️

Named Instructions

Giving a group of steps a name you can reuse

That's genuinely the whole list. Every program β€” a website, a game, a banking system β€” is these four ideas, combined and layered, over and over, at massive scale.

πŸ’‘
You don't need to "think like a programmer" yetYou already think in steps constantly β€” getting ready in the morning, following driving directions, assembling furniture. Programming is that same everyday skill, just written down with unusual precision for an audience (the computer) that won't guess what you meant.
🧠 Quick Check
Why does a recipe make a good comparison for a computer program?
LESSON 2 Β· THE BIG IDEAS

πŸ“¦ Storing Information

The first building block from last lesson. Every useful program needs to remember things β€” a score, a name, a total β€” while it runs. Here's what that actually means, before any C++ syntax.

🏷️ A Labeled Box

Think of a variable as a labeled box. You put a value inside it β€” a number, a word, whatever β€” and you give the box a name so you can find it again later. "Put 5 into a box named score" is exactly what a line of code like int score = 5; means. The name is how you refer to the value later; the box is where the value actually lives while your program runs.

πŸ“ Sticky Notes on Your Desk

Imagine you write "Phone Number" on a sticky note, and under it, the actual number. Later, you glance at the note labeled "Phone Number" instead of trying to remember the digits yourself. A variable is that same idea: a labeled place to keep a value so your program (and you, reading the code later) can refer to it by a meaningful name instead of remembering the raw value everywhere.

πŸ”’ Not Every Box Holds the Same Kind of Thing

A box meant for whole numbers doesn't sensibly hold a word, and a box meant for text doesn't sensibly hold a decimal number. This is why programming languages β€” including C++ β€” have different types of boxes for different kinds of information:

Kind of InformationReal-World Example
A whole numberSomeone's age, a score, a count of items
A decimal numberA price, a temperature, a measurement
TextA name, an address, a sentence
A yes/no valueIs the door locked? Is the game over?

C++ is unusually strict (compared to some languages) about knowing in advance exactly what KIND of box you're creating β€” this is a deliberate design choice that catches a whole category of mistakes before your program even runs, which you'll appreciate much more once you've been burned by the alternative.

♻️ Boxes Can Be Changed

Unlike a real sticky note you'd have to cross out and rewrite, a variable's value can simply be updated β€” put a new value in the same labeled box, replacing the old one. Your program might store a score of 0 at the start, then update that exact same box to 10, then 25, as the game progresses. The label (the name) stays the same; what's inside changes.

πŸ’‘
Why this matters before you've written any codeAlmost every bug a beginner runs into traces back to a variable holding a value they didn't expect β€” the wrong type, an old value that should've been updated, or a box that was never given a value at all. Understanding "it's just a labeled box holding one thing at a time" now will make debugging dramatically less mysterious later.
🧠 Quick Check
What is a variable, in plain terms?
LESSON 3 Β· THE BIG IDEAS

πŸ”€ Making Decisions

A program that does the exact same thing every single time isn't very useful. This building block is how a program reacts differently depending on the situation.

πŸ€” "If This, Then That"

A decision in code follows one simple shape: check whether something is true, and if it is, do something specific. Optionally, you can also say what to do if it ISN'T true. That's genuinely the whole concept β€” everything else is just detail on top of "if this, then that, otherwise this other thing."

β˜‚οΈ Deciding Whether to Bring an Umbrella

"If it's raining, bring an umbrella. Otherwise, don't." You check one condition (is it raining?), and your action depends entirely on the answer. You don't bring an umbrella AND not bring one β€” the condition determines exactly one path. Every decision in a program works the same way: check a condition, follow exactly one resulting path.

βœ…βŒ Conditions Are Always Yes-or-No

A condition a program checks always boils down to something that's either true or false β€” never "sort of" or "maybe." "Is the score greater than 100?" "Is the door open?" "Did the user type the correct password?" Each of these has exactly one honest answer at any given moment: yes or no. This yes/no nature is precisely what lets the computer make a clean, unambiguous decision.

πŸͺœ Decisions Can Chain Together

Real decisions are often more layered than a single yes/no β€” "if it's raining AND I don't have a car, bring an umbrella AND wear boots. Otherwise, if it's just cold, wear a coat. Otherwise, wear whatever." This is still built from the same basic "if this, then that" idea β€” just multiple conditions checked in sequence, with the program following whichever path actually matches the real situation.

Is it raining? β”œβ”€β”€ YES β†’ Do I have a car? β”‚ β”œβ”€β”€ YES β†’ Drive, no umbrella needed β”‚ └── NO β†’ Bring an umbrella, wear boots └── NO β†’ Is it cold? β”œβ”€β”€ YES β†’ Wear a coat └── NO β†’ Wear whatever
πŸ’‘
Almost everything "smart" a program does is really just decisionsA video game enemy that reacts to the player, a website that shows different content to logged-in users, a thermostat that turns on the heat β€” none of it is mysterious "intelligence." It's decisions, checked constantly, based on the current situation. You already understand the entire concept; C++ syntax is just how you'll eventually write it precisely.
🧠 Quick Check
Why must a condition in a program always be strictly true or false, rather than something in between?
LESSON 4 Β· THE BIG IDEAS

πŸ” Repeating Things

If you needed to do something 1,000 times, would you really want to write the same instruction 1,000 times? This building block is how a program repeats a step without repeating the instruction itself.

πŸ”‚ Say It Once, Repeat It Many Times

A loop lets you write a step (or group of steps) a single time, and tell the computer "now do this again and again" β€” either a specific number of times, or until some condition (from last lesson!) is no longer true. The computer handles the actual repetition; you only ever write the instruction once.

πŸƒ Doing 20 Push-Ups

A trainer doesn't say "do a push-up" 20 separate times. They say "do 20 push-ups" β€” one instruction, with a repeat count built in. You already know exactly how to follow that instruction. A loop in code is the same idea: one instruction, plus how many times (or under what condition) to repeat it.

πŸ”’ Two Common Shapes of Repetition
ShapeReal-World Example
Repeat a known number of times"Do 20 push-ups" β€” you know the count in advance
Repeat until a condition changes"Keep stirring until the sauce thickens" β€” you don't know exactly how many stirs, you just keep going until the condition (thick enough) becomes true

Both shapes exist in C++ (you'll meet them properly as for and while loops later in this course) β€” but conceptually, they're both just "repeat this step, either N times or until something changes."

πŸ”— Combining Decisions and Loops

The real power shows up when you combine last lesson's decisions WITH repetition: "Keep drawing cards until you have a total of 21 or more, but if you ever go over 21, stop and you lose." That single sentence already contains a loop (keep drawing) and a decision (checked every single repetition) working together β€” and this exact kind of combination is the backbone of almost every real program you'll ever write.

⚠️
A loop needs a way to actually stopIf a loop's repeat condition is never satisfied β€” say, you tell it to "keep going until X happens" but X can genuinely never happen β€” the computer will try to repeat forever, freezing your program. This is called an infinite loop, and it's one of the most common early mistakes. You'll learn to spot and avoid it once loops appear in actual C++ syntax.
🧠 Quick Check
"Keep stirring until the sauce thickens" is an example of which kind of repetition?
LESSON 5 Β· THE BIG IDEAS

🏷️ Named Instructions

The last of the four core building blocks. What if a whole GROUP of steps needs to happen over and over, in different places in your program β€” not just one single instruction?

πŸ“› Giving a Group of Steps a Name

A function is a named, reusable group of instructions. You write the steps once, give them a name, and from then on, you can run that whole group just by using its name β€” anywhere in your program, as many times as you want β€” instead of retyping every step each time.

β˜• "Make Coffee" as a Named Routine

You don't consciously think through "grind beans, boil water, pour, wait, add milk" as five separate decisions every single morning. You just think "make coffee" β€” a single named routine that bundles all five steps together. Anyone who understands what "make coffee" means can trigger that whole sequence with one short instruction. A function in code is exactly this: a named bundle of steps you (or your future self, or a teammate) can trigger with one short line.

πŸ“₯ Functions Can Take Information In

"Make coffee" is useful, but "make coffee, but with oat milk instead" is more flexible. A function can accept information when it's used β€” called parameters β€” that changes exactly how it behaves that specific time, without needing an entirely separate named routine for every possible variation.

πŸ“€ Functions Can Give Information Back

A function can also hand a result back to whatever asked it to run β€” "what's 15% of this restaurant bill?" is a named routine that takes a number in and gives a specific answer back out, rather than just performing an action. This "takes something in, gives something back" pattern is one of the most common and useful shapes a function takes.

🧩 Why This Building Block Matters So Much

Functions are how real programs stay manageable as they grow. Instead of one enormous, tangled list of thousands of steps, a real program is broken into many small, clearly-named functions β€” each handling one specific job β€” that call each other in combination. This is also exactly why good naming matters: a function called calculateTax tells you what it does without needing to re-read every step inside it.

πŸ’‘
You've now met all four Big IdeasStoring information, making decisions, repeating things, and named instructions. Every C++ program in this entire course β€” and every program you'll ever encounter in your career β€” is these four ideas, combined and layered. The rest of this course is genuinely just teaching you the precise C++ way to write what you already understand conceptually.
🧠 Quick Check
What is the main benefit of grouping steps into a named function instead of retyping those steps everywhere they're needed?
LESSON 6 Β· THE BIG IDEAS

🧠 How a Computer Reads Code

One last conceptual piece before Section 2 gets your actual computer ready. This is about the computer's mindset β€” not what it understands, but how mechanically it moves through your instructions.

➑️ Top to Bottom, One Line at a Time

Unless a decision or a loop (from the last two lessons) says otherwise, a computer reads and runs your code exactly like you'd read a page of text: top to bottom, one instruction at a time, in the order it's written. It doesn't skip ahead, doesn't guess what comes next, and doesn't run two instructions at once by default.

πŸ—ΊοΈ Following Turn-by-Turn Directions

"Turn left on Main Street. Go straight for two miles. Turn right at the gas station." You follow these in order, one at a time β€” you don't jump to step 3 before finishing step 1. If step 2 said "go straight for two miles, UNLESS you see a detour sign, in which case take the detour" β€” that's a decision changing your path, exactly like an if statement changes a program's path. But without that kind of instruction, you just go top to bottom.

πŸ€– The Computer Does Not "Understand" Your Intent

This is the single most important mindset shift for a beginner. A computer doesn't guess what you probably meant, and it doesn't fill in gaps using common sense. If your instructions say to do something in an order that doesn't actually make sense β€” like using a variable's value before you've ever given it one β€” the computer will do exactly that broken thing, not politely correct your mistake for you.

⚠️
This is genuinely good news, once it clicksBecause the computer always does EXACTLY what your instructions say β€” no more, no less β€” every bug has a real, findable, logical cause. It's never "the computer is being weird." It's always "the instructions say something I didn't intend," which means it's always fixable once you find the actual instruction that's wrong.
πŸ“ Precision Matters More Than It Does in Human Language

When you talk to a person, "kind of," "sort of," and "probably" are perfectly normal. A computer has no tolerance for that kind of vagueness β€” an instruction either says exactly what to do, or it doesn't compile or run at all. This isn't the computer being unreasonably strict for no reason; it's simply what "no guessing, no assumptions" requires in practice. You'll get comfortable with this precision quickly β€” it becomes second nature within your first few real programs.

🧠 Quick Check
If a program behaves unexpectedly, what does that actually mean, based on how a computer reads code?
LESSON 7 Β· GETTING YOUR COMPUTER READY

βš™οΈ What a Compiler Actually Does

Here's where this course genuinely earns its "for someone who's never touched a compiler" promise. C++ has an extra step that some other languages hide from you β€” and understanding it now will save you real confusion later.

🌐 Two Kinds of Languages

Broadly, programming languages fall into two camps for how they actually run:

KindHow It RunsExample
InterpretedAnother program reads your code and carries out each instruction "live," on the spot, every time you run itPython, JavaScript
CompiledA separate program translates your entire code, once, into a form the computer's processor can run directly β€” before you ever run itC++, C, Rust

C++ is compiled. This is the single biggest practical difference you'll notice coming in with no prior experience: you don't just "run" your C++ code directly. You compile it first, and THEN run the result.

πŸ“– Translating an Entire Book vs. Live Interpretation

An interpreter at a live event translates what's said, sentence by sentence, in real time, as the speaker talks. A book translator instead takes the entire original book and produces a complete translated book β€” a finished, separate product β€” before anyone reads a single page of it. A compiler works like the book translator: it takes your ENTIRE C++ program and translates all of it, up front, into a separate, ready-to-run program. Only after that translation finishes do you actually run anything.

πŸ”€ From Human-Readable C++ to Machine Code

The code you'll write is genuinely readable by a person (once you know the syntax) β€” words like if, while, and meaningful variable names. But a computer's processor doesn't actually run that text directly; it only runs extremely low-level binary instructions called machine code. The compiler is the program that bridges this gap: it reads your human-readable C++ source code and produces the machine code your specific computer can actually execute.

Your C++ code β†’ Compiler β†’ An executable file β†’ What you run (source.cpp) translates it (machine code)
πŸ” The Real Cycle You'll Repeat Constantly

Every single time you change your code, you'll repeat the same three-step cycle: write (edit your source code), compile (translate it into a runnable program), run (actually execute it and see what happens). If the compiler finds a mistake in your code, it stops and shows you an error instead of producing a runnable program at all β€” you fix the mistake, and compile again. Lesson 12 covers exactly how to read those error messages without panicking.

πŸ’‘
Why this extra step is actually a genuine advantageBecause the compiler checks your ENTIRE program up front, it catches a huge number of mistakes before your program ever runs even once β€” instead of discovering them mid-execution, possibly after a user has already hit the broken part. This is one of C++'s real, practical strengths, not just an inconvenience beginners have to tolerate.
🧠 Quick Check
What does a C++ compiler actually do with your source code?
LESSON 8 Β· GETTING YOUR COMPUTER READY

πŸ”§ Installing Your Toolchain

Time to actually set up your computer. This lesson walks through getting a real C++ compiler and editor installed β€” the two things you genuinely need before writing a line of code.

🧰 The Two Things You Actually Need
ToolWhat It's For
A compilerTranslates your C++ code into a runnable program (Lesson 7)
An editor or IDEWhere you actually type and organize your code β€” ranges from a simple text editor up to a full Integrated Development Environment with built-in error-checking, auto-complete, and a debugger

This course recommends installing an IDE rather than a bare text editor, specifically because an IDE bundles helpful features (like catching simple mistakes as you type) that make the very beginning of your C++ journey noticeably less frustrating.

πŸ’» By Operating System
OSRecommended Setup
WindowsInstall Visual Studio Community (free) β€” it bundles Microsoft's compiler and a full IDE in one installer, and is the most beginner-friction-free path on Windows specifically
macOSInstall Xcode Command Line Tools (provides the clang compiler) from the App Store or via Terminal, then use an editor like VS Code or CLion
LinuxInstall the g++ compiler through your distribution's package manager (for example, sudo apt install g++ on Ubuntu/Debian), then use an editor like VS Code or CLion
πŸ’‘
If you've already looked at this platform's CLion GUI Development courseCLion is a genuinely excellent, cross-platform IDE choice for C++ specifically, and works identically across Windows, macOS, and Linux. This Pre-Course's instructions work with any setup β€” pick whichever path matches what you're most likely to stick with.
βœ… Verifying the Install Actually Worked

After installing, the most reliable way to confirm everything's actually working is to check your compiler's version from a terminal (Lesson 9 covers terminals properly, but here's a preview): open a terminal window and type g++ --version (or clang++ --version on macOS). If a version number prints back, your compiler is correctly installed and ready. If you instead see an error like "command not found," the installation didn't complete correctly, or the compiler isn't on your system's PATH β€” a very common first hurdle, and not a sign you did anything unusually wrong.

πŸ§‘β€πŸ”§ A Note on Getting Stuck Here

Toolchain installation is, honestly, one of the most common places beginners get stuck β€” often before they've written a single line of actual code. If something doesn't work on the first try, that's completely normal and not a reflection of your ability to learn C++. Searching your exact error message plus your operating system is a genuinely effective troubleshooting strategy, and one you'll keep using throughout your entire programming career, not just here.

🧠 Quick Check
What are the two essential tools you need installed before writing your first C++ program?
LESSON 9 Β· GETTING YOUR COMPUTER READY

⌨️ The Terminal, Just Enough

If you've only ever used a computer by clicking icons, a black screen full of typed text can feel intimidating. This lesson covers exactly enough to get you comfortable β€” not a deep dive, just what you'll actually use.

πŸ–±οΈ vs. ⌨️ Clicking vs. Typing Commands

Everything you've done on a computer so far β€” opening apps, moving files β€” has a typed equivalent. A terminal (also called a command line or console) is a program where, instead of clicking, you type the name of what you want to do. It's not a more "advanced" computer underneath β€” it's the same computer, just a different way of telling it what to do, and one that happens to be how you'll compile and run C++ programs throughout this entire course.

πŸšͺ Opening a Terminal
OSHow to Open It
WindowsSearch for "Command Prompt" or "PowerShell" in the Start menu
macOSSearch for "Terminal" using Spotlight (Cmd+Space, then type "Terminal")
LinuxUsually Ctrl+Alt+T, or search for "Terminal" in your applications menu

Most IDEs (including Visual Studio and CLion) also have a terminal built directly into the application window, so you may not even need to open a separate one once your editor is set up.

πŸ”‘ The Handful of Commands You Actually Need Right Now
CommandWhat It DoesExample
pwd (Mac/Linux) / cd alone (Windows)Shows which folder you're currently "in"pwd
ls (Mac/Linux) / dir (Windows)Lists the files and folders in your current locationls
cd folder-nameMoves into a folder ("change directory")cd projects
cd ..Moves back up one folder levelcd ..
πŸ’‘
This genuinely is enough to get startedYou don't need to memorize dozens of commands to begin writing C++. These four cover navigating to where your code lives β€” which, combined with the compile command from the next lesson, is the entire terminal workflow you'll use throughout most of this course.
⌨️ A Few Habits That Help
  • Press Tab to auto-complete. Start typing a file or folder name and press Tab β€” most terminals will finish it for you, saving typing and avoiding typos.
  • Press the Up arrow to reuse a previous command instead of retyping it.
  • Capitalization and exact spelling matter. A terminal won't guess what you meant the way a search engine might.
🧠 Quick Check
What is a terminal, in plain terms?
LESSON 10 Β· GETTING YOUR COMPUTER READY

πŸ“ Files, Folders & Paths

You already understand files and folders from everyday computer use. This lesson connects that existing knowledge to how you'll organize and locate your actual C++ projects.

πŸ“„ A Source File Is Just a Text File

A C++ program starts as a plain text file β€” genuinely no different in kind from a .txt file, just saved with a .cpp extension instead, which tells your compiler and editor "this text is C++ code." You'll create, save, rename, and organize these files exactly like any other file you've ever worked with β€” the only new part is what you'll type inside them.

πŸ—‚οΈ Organizing a Project Folder

Just like you might keep a folder for photos and a separate one for documents, you'll want a dedicated folder for your C++ projects β€” commonly something like a folder named cpp-projects inside your Documents. Inside that, most people create a separate subfolder for each individual program or project, keeping related files together and separate from unrelated ones.

Documents/ └── cpp-projects/ β”œβ”€β”€ hello-world/ β”‚ └── main.cpp └── calculator/ └── main.cpp
πŸ›£οΈ What a "Path" Actually Means

A path is just the full set of directions to a specific file or folder, written out β€” the same information you'd give someone verbally ("it's in Documents, then cpp-projects, then hello-world"), just written in a compact, standard format.

TypeWhat It MeansExample
Absolute pathThe complete route from the very top of your file system/Users/yourname/Documents/cpp-projects/hello-world/main.cpp
Relative pathDirections starting from wherever you currently arecpp-projects/hello-world/main.cpp (if you're already in Documents)
πŸ’‘
This connects directly to last lesson's terminal commandscd cpp-projects uses a relative path β€” "go into the folder named cpp-projects, starting from wherever I already am." Understanding paths is what makes terminal navigation actually make sense, instead of feeling like memorized magic words.
πŸ‘€ Showing File Extensions

Both Windows and macOS hide file extensions (the .cpp, .txt part) by default in their file browsers β€” genuinely useful for casual computer use, but actively unhelpful once you're writing code, since you'll frequently need to see and confirm exact file extensions. It's worth turning this setting on now: search "show file extensions" plus your operating system for quick, current instructions.

🧠 Quick Check
What's the difference between an absolute path and a relative path?
LESSON 11 Β· THE BRIDGE

πŸŒ‰ From English to C++

Every concept in Section 1 is about to get its real C++ syntax for the first time. Nothing here is new IDEA-wise β€” you already understand every one of these β€” this is purely translation.

πŸ“¦ Storing Information, in C++

Remember the "labeled box" from Lesson 2? In C++, creating one looks like this:

C++
int score = 5;
double price = 19.99;
std::string name = "Alex";

Read the first line as: "Create a whole-number box named score, and put 5 in it." int is the TYPE of box (whole numbers), score is the label, and = 5 is what goes inside. The semicolon simply marks "this instruction is finished" β€” C++ uses it to know where one instruction ends and the next begins, since (unlike English) it doesn't rely on line breaks alone.

πŸ”€ Making Decisions, in C++
C++
if (score > 100) {
    // do this if the condition is true
} else {
    // do this otherwise
}

This is precisely "if it's raining, bring an umbrella, otherwise don't" from Lesson 3 β€” if (condition) introduces the check, the curly braces { } group together everything that should happen for that branch, and else covers the "otherwise" case.

πŸ” Repeating Things, in C++
C++
for (int i = 0; i < 20; i++) {
    // do this 20 times
}

This is "do 20 push-ups" from Lesson 4. You'll learn exactly what each of the three parts inside the parentheses means in Module 2 β€” for now, just recognize the shape: a loop repeats whatever's inside its curly braces.

🏷️ Named Instructions, in C++
C++
int calculateTax(double price) {
    return price * 0.08;
}

This is "make coffee" from Lesson 5 β€” a named routine (calculateTax) that takes information in (price) and gives a result back (return). You'll call this named routine elsewhere in your program just by writing calculateTax(19.99).

πŸ’‘
Notice the curly braces showing up everywhereIn C++, { } is how you group a set of instructions together β€” whether that's "everything that happens if this condition is true," "everything that repeats in this loop," or "everything inside this named routine." It's the same grouping idea, reused consistently across every one of the Big Ideas.
🧠 Quick Check
What do curly braces { } generally represent across C++ code?
LESSON 12 Β· THE BRIDGE

πŸš€ Your First Real Program

Everything so far has been concept and setup. This lesson is where you actually write, compile, and run a real C++ program β€” the classic first step, done for real on your own machine.

πŸ“ Step 1 β€” Create the File

Using your project folder from Lesson 10, create a new file named exactly main.cpp inside a fresh folder (something like cpp-projects/hello-world/). Open it in your editor or IDE from Lesson 8, and type the following exactly as shown:

main.cpp
#include <iostream>

int main() {
    std::cout << "Hello, world!" << std::endl;
    return 0;
}
πŸ” What Every Line Actually Means
LineWhat It Does
#include <iostream>Brings in the tools for input/output (like printing text to the screen) β€” C++'s core language doesn't include this by itself, so you explicitly ask for it
int main() {Every C++ program needs exactly one function named main β€” it's the specific named routine (Lesson 5!) the program starts running from, automatically, every time
std::cout << "Hello, world!" << std::endl;Prints the text "Hello, world!" to the screen, then moves to a new line
return 0;Tells the operating system the program finished successfully (0 conventionally means "no errors")
}Closes the curly brace that opened with main() β€” marking the end of that function's instructions
βš™οΈ Step 2 β€” Compile It

Open a terminal (Lesson 9), navigate to your project folder using cd, and run:

Terminal
g++ main.cpp -o hello

Read this as: "compiler, translate main.cpp, and name the resulting program hello." If nothing prints back and you're returned to a normal prompt, it worked β€” no news is good news here. A new file (on Mac/Linux, named hello; on Windows, hello.exe) now exists in that same folder.

▢️ Step 3 β€” Run It
Terminal
./hello

(On Windows, just type hello without the ./.) You should see Hello, world! printed to your screen. If you see that β€” genuinely, congratulations. You just wrote, compiled, and ran a real C++ program, from nothing, on your own machine.

πŸ’‘
The "./" isn't a typoOn Mac and Linux, this tells the terminal "run the program named 'hello' that's right here in this folder" β€” a small security-related default that prevents accidentally running a program with the same name from somewhere unexpected. You'll type it automatically within a day or two.
🧠 Quick Check
In the Hello World program, what specifically is the purpose of the line int main() {?
LESSON 13 Β· THE BRIDGE

🩹 Reading an Error Message

You will see compiler errors. Constantly, forever, at every experience level β€” this never fully goes away, and that's completely normal. This lesson makes them far less intimidating.

😰 Why Error Messages Feel So Scary at First

A C++ compiler error can look like a dense wall of unfamiliar text. But underneath the intimidating formatting, it's always trying to tell you exactly three things: which file the problem is in, which line it's on, and what specifically the compiler couldn't understand. Once you know to look for those three pieces, the wall of text becomes much more approachable.

πŸ”¬ A Real Example, Broken Down

Suppose you accidentally forgot a semicolon:

main.cpp
int score = 5
int total = 10;

The compiler might respond with something like:

Compiler Output
main.cpp:2:1: error: expected ';' after top level declarator
    int total = 10;
    ^
    ;
PartWhat It Tells You
main.cpp:2:1File name, then line 2, then column 1 β€” exactly where the compiler got confused
error:This is a genuine problem, not just a suggestion β€” your program will not compile until it's fixed
expected ';' after top level declaratorThe compiler's description of what it expected to find and didn't
The ^ and the code snippetA visual pointer showing roughly where, in your actual code, the problem was detected
⚠️
The reported line isn't always where the real mistake isNotice the error above points to line 2 β€” but the ACTUAL missing semicolon is at the end of line 1. This is extremely common: the compiler often doesn't realize something's wrong until it reads a bit further than the actual mistake. When a fix doesn't seem to make sense on the exact reported line, check the line just above it too.
🧭 A Simple Process for Any Error
  1. Find the file and line number β€” go directly there in your editor.
  2. Read the error description slowly β€” it's often more literally accurate than it first feels.
  3. Check the line above, too β€” per the callout above.
  4. If you're stuck, search the exact error text β€” copy the core error message (not your specific variable names) into a search engine. This is a completely normal, universally-used technique, not a sign of inexperience.
πŸ’‘
Fix the first error firstOne small mistake can sometimes cause the compiler to report several confused-looking errors afterward, all stemming from that same single root cause. Always fix the very first error in the list and recompile before worrying about the rest β€” often, most of the others simply disappear once the real problem is fixed.
🧠 Quick Check
A compiler error points to line 8, but you can't find anything wrong there. What's a sensible next step?
LESSON 14 🏁 · THE BRIDGE

βœ… You're Ready

Let's take stock of everything covered before Phase 1 begins. You've come a genuinely long way from "only knows how to use a PC."

🧱 What You Actually Know Now
πŸ“¦

Storing Information

What a variable is, and why types matter

πŸ”€

Making Decisions

How "if this, then that" actually works

πŸ”

Repeating Things

Loops, and both shapes they take

🏷️

Named Instructions

Functions, parameters, and return values

Plus the mechanical skills that make all four of those actually usable: what compiling means, a working C++ toolchain installed on your own machine, enough terminal command to navigate confidently, understanding files/folders/paths, and β€” critically β€” the ability to read a compiler error without panicking.

🎯 What's Genuinely Different About You Now

You've already done the two things that stop most people before they really start: you got a real compiler working on your own computer, and you compiled and ran a real program successfully. Everything from here is deepening skills you've already started using β€” not starting from zero again.

πŸ—ΊοΈ What's Next

Phase 1 (C++ Fundamentals) picks up exactly where this Pre-Course leaves off β€” the same four Big Ideas, now explored in real depth with real C++ syntax: every data type, every operator, proper input with cin, and enough practice to make writing a variable declaration feel automatic instead of something you have to think through step by step.

🏁 Before You Move On

One Small Modification

Go back to your hello-world project from Lesson 12. Change the program to print your own name instead of "world," then recompile and run it again. This sounds trivial β€” but doing it yourself, end to end, one more time, is exactly the repetition that turns "I followed along" into "I can actually do this."

  • Open main.cpp in your editor
  • Change the text inside the quotes
  • Save the file
  • Recompile with g++ main.cpp -o hello
  • Run it again with ./hello and confirm your change actually shows up
Roadmap