Hey there this is which is about output (printing) and input (text based) in C++. So let´s get started!

 

First what you want to know is that there are a few ways in which you can print something in your programs.

 

For outputting there is:

 

cout

std output stream

cerr

Std error (output) stream

clog

std logging (output) stream

 

This basically work the same all of them they just differ on their purpose. Cerr and clog are already predetermined to work as as error or logging strings or values.

 

The following actions would…

 (Not using the greater than symbols because the blog erases the content)

Cout xendl; – Print the value of x.

 

Cout 20 endl; – Print the number 20.

 

Cout “Hello” endl; – Print the string Hello.

 

The (less than symbol) operator inserts the data that follows it into the stream

 

 

cin

standard input stream

 

 

Cin, Lets the users to input some text (string) or actual value into the program. Is the way to introduce information to the coding and let it interact.

 

WATCH MY VIDEO https://youtu.be/Dhtw_9QTV3U

CC BY 4.0 #Mastery10 – Basic output (printing) and input (text based) in C++ by Ricardo Newton is licensed under a Creative Commons Attribution 4.0 International License.