- 01Getting Started
- 02Your First Output (cout)
- 03Variables and Types (int/double/string/bool)
- 04Conditionals (if statements)
- 05Loops (for statements)
- 06Writing a Function
- 07Working with Arrays
- 08Loops (while statements)
- 09Pointer Basics
- 10References
- 11Classes (Object-Oriented Programming)
- 12Constructors and Destructors
- 13Inheritance
- 14Using vector (the Standard Library)
- 15String Manipulation (string)
- 16Structs (struct)
- 17Error Handling (try/catch)
- 18The Ternary Operator
- 19The switch Statement
- 20[Applied] Build a Mini Inventory Management System
Your First Output (cout)
This lesson covers the basics of output in C++ using cout. It's for anyone searching "C++ cout tutorial."
std::cout << prints text to the screen. C++ builds on C, adding object-oriented programming and safer features on top โ it's known for being extremely fast.
The example loads input/output functionality like cout with the line #include <iostream>, then outputs a string with std::cout << "Hello, C++!" << std::endl;. It helps to picture the << symbol as an arrow "pouring a value in."
A common early mistake is forgetting #include or std::. In C++, you need to include the header file for whatever feature you're using, and forgetting to do so produces a compile error.
In real projects, C++ is still used across a wide range of fields today wherever speed matters โ game development, embedded devices, high-performance financial systems, and more.
๐งช This site can't compile or run C++ directly, so it checks on the spot whether what you typed matches the reference code (scoring happens entirely in your browser โ nothing is sent anywhere).
