C++ for Beginners / Chapter 1 — From C to C++ (lessons 1–7) / Lesson 1
Your First Steps in C++ (Building with clang++)
Time needed: about 3 min (estimate)
Reading settings
These settings are remembered on this device only.
You can try the opening of this lesson without an account.
C++ is a language "built on top of C"
C++ contains almost all of C.
You can use int, for, and malloc as-is, so if you know C, you can write C++ on day one.
This course starts there and moves toward handing the things you managed by hand in C over to the language.
First, let's check the compiler on your machine.
Terminal
$ clang++ --version
Apple clang version 21.0.0 (clang-2100.3.34.2)
Target: arm64-apple-darwin27.0.0
Thread model: posix
InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin
Your first program
Create a free account to keep reading
With an account you can read the rest of this lesson, take the quiz, and read every free lesson in this course. Lessons you answer correctly are recorded as complete.
Report a problem with this lesson
Log in to send a report.