cadence_learn
the_c++_track / level 03 of 15 ▶ 16 min

the wall of red, decoded.

You will spend more of week two reading error messages than writing code. Here are the seven you will actually meet, with the real output — including three that never complain at all.

after this level you'll be able to
  • Read the four fields of a compiler message and find the character it names
  • Recognise the seven mistakes beginners make most often
  • Explain why a warning is more dangerous than an error
the wall of red

the compiler is not angry with you

the one sentence

Compiler errors look like the machine shouting. They are actually a fixed format, saying which character it got to before it stopped understanding — and there are about eight of them you will meet over and over.

This level exists because the first month of C++ is mostly this, and nobody teaches it. You will spend more time reading these messages than writing code, and they go from terrifying to routine faster than you would think — but only once you know what you are looking at.

how to read a compiler message
e.cpp:4:14: error: expected ';' at end of declaration 4 | int x = 5 | ^ WHICH FILE LINE COLUMN HOW BAD WHAT IS WRONG the caret points at the exact character it got to Read it right to left: what is wrong, then where. And always fix the FIRST error only, then compile again. One mistake usually produces several messages. The ones after the first are often just the compiler being confused by the first.
It is a format, not a paragraph. Once you can see the four fields, a wall of red becomes a sentence telling you which character to go and look at.
the single most useful habit

Fix only the first error, then compile again. One missing brace can produce forty messages, and thirty-nine of them are the compiler thrashing around after it lost its place. Beginners read all forty and despair. Read the first one. Fix it. Compile.

the ones you will actually meet

seven messages, decoded

Every message below is real — produced by running the broken code through the same compiler you set up in level 1. Click through them now, calmly, so that when one appears at midnight you have already seen it.

▤ lab · the error decoder

Seven of these. Note that the last three are not errors at all — which is what makes them worse.

Pick one on the left. Start with the semicolon — it is the one you will meet first.
◈ ask an ai about this

“I got a C++ compiler error I do not understand. How do I read the message, and why does it sometimes point at the wrong line?”

chatgpt ↗ claude ↗

the dangerous half

a warning is not a lesser error

Notice what happened in the last three. An error stops the compile. A warning does not — your program is built, it runs, and it does the wrong thing while looking completely healthy.

That is the third column from level 11 — the kind of wrong that finishes cleanly and lies to you. And it is exactly why -Wall belongs in every compile you ever run: without it, some of these say nothing at all.

the one with no message whatsoever

Integer division has no error and no warning, in any compiler, ever. 7 / 2 is 3, because both sides are whole numbers so C++ does whole-number division and throws the remainder away. Your average comes out wrong, everything compiles, nothing complains. This will get you at least once this semester — and now you know its name.

◈ ask an ai about this

“What is the difference between a compiler error and a warning in C++, and why is integer division dangerous?”

chatgpt ↗ claude ↗

do this together

collect them like stamps

☶ two people · 15 minutes · keep the notes

Start an error notebook. Seriously — one file, added to all semester.

person a

Break the hello world program in a new way. Compile. Copy the exact message.

person b

Write the plain-English translation next to it and what fixed it. One line each. No jargon allowed.

By week four you will have fifteen of them and you will stop needing the notebook — which is the point. The people who find this course hard are usually not worse at logic. They are just still frightened of the error messages, which makes them change things at random instead of reading. Reading is the whole skill.

what to keep

three things worth remembering

01

Fix the first one only

Then compile again. Later messages are usually noise from the first mistake.

02

The line number can lie

A missing semicolon is reported on the line after it. Always check the line above.

03

Warnings are the scary ones

An error stops you. A warning lets a broken program run. Never compile without -Wall.

check yourself

3 questions before you move on

Not recall — these are the shapes an exam actually uses. Every answer below was produced by compiling and running the code, so if you disagree with one, the compiler is the one to believe.

▢ check yourself3 questions

Have a real go before revealing. Being wrong here is worth more than being right in three weeks.

01

The compiler says expected ‘;’ and points at line 5. Where is the missing semicolon most likely to be?

02

One mistake produces forty error messages. What should you do?

03

Which of these is the DANGEROUS kind of wrong?

answered: 0 of 3right first time: 0
Stuck? Peter reads these personally and replies to your email.
Ask Peter →