Back to Course

Introduction to C++

0% Complete
0/0 Steps
  1. C++: Basics
    5Topics
    |
    6 Quizzes
  2. C++: Compilation and Execution
    5Topics
    |
    6 Quizzes
  3. C++: Variables
    9Topics
    |
    10 Quizzes
  4. C++: Conditions Operators
    5Topics
    |
    6 Quizzes
  5. C++: Logical Operators
    3Topics
    |
    4 Quizzes
  6. C++: Loops and Errors
    8Topics
    |
    9 Quizzes
  7. C++: Vectors
    4Topics
    |
    3 Quizzes
Lesson 1, Topic 3
In Progress

C++: Character Output Stream

Yasin Cakal 26 Oct 2021
Lesson Progress
0% Complete

Let us try and comprehend the code we entered to receive the desirable output. C++ is no different from other programming languages. The code runs through each line starting, at the top of the page and ending at the end. Let us look at some of the lines you added to the print Hello, World!.

#include is added in the code to add and use libraries.

int main() is known as the main() function. Each function begins with a curly bracket { and ends at a curly bracket }. In between the brackets, we add the code to execute what we want.

For now, our focus is on what is between the curly brackets. We had the following line between the brackets:

std::cout<<"Hello, World!";

std::cout is known as the ‘character output stream.’ Its pronunciation is ‘see-out.’

cout is followed by an operator <<.

There is a punctuation ; present at the end of the line. This is used like a full stop in a regular sentence. It marks the end of a line.

Punctuation " are used after the operators <<. This prints whatever falls between these punctuations, In this code, we added "Hello, World!" in between these punctuations and, hence, it is the output of the code.

Now, try writing your own code to learn better!

%d bloggers like this: