C++ is equipped with another operator used to request values from the user
The user usually provides such a value by typing it using the keyboard
The cin operator is used for that purpose
(Pronounce “see in”)
It displays a blinking cursor on the monitor to let the user know that a value is expected
Uses two greater than signs [...]
To process the information of your program or the requests that your program presents to the user, the computer uses
(B-1) Two types of storage spaces
(B-1) The hard drive
A static storage area that keeps its information all the time, almost regardless of what happens to your computer
(B-1) Random Access Memory (RAM)
This storage area keeps its information [...]
Let’s look at how to display a message
The myfirst.cpp program (A-1)
Uses the following C++ statement (A-2):
The part enclosed within the double quotation marks is the message to print
In C++, any series of characters enclosed in double quotation marks is called a character string, presumably because it consists of several characters strung together into a larger [...]
C++ works by giving (separate) instructions to the computer
Instructions can be treated as assignments
Assignment will be…
Called a function
The primary function used in C++
Is called main
Function’s name is
Followed by an opening and a closing parentheses
Main function will always be written
At least as main()
When a program is written and you ask the computer to “execute” it, the [...]
A namespace
A section of code
Delimited and referred to using a specific name
Give a common name to that portion of code so that, when referring to it, only entities that are part of that section would referred to
A namespace is created to
Set apart a portion of code with the goal to reduce, otherwise eliminate, confusion
How to [...]
The libraries are
(Also) called header files
And, as computer files
They have the extension “.h”
house.h
person.h
They could have any name
iostream
Asks the computer to display stuff on the monitor’s screen
How to put a library in your program
Put it at the beginning of the file (A-1)
Example of (A-1)
iostream.h
How to use a library in your program
Simply include it by using the [...]