100% tevredenheidsgarantie Direct beschikbaar na je betaling Lees online óf als PDF Geen vaste maandelijkse kosten 4.2 TrustPilot
logo-home
Samenvatting

COS132 Chapter 2 summary

Beoordeling
-
Verkocht
-
Pagina's
11
Geüpload op
20-04-2022
Geschreven in
2021/2022

Summary study book Starting Out with C++ of Tony Gaddis - ISBN: 9780132926867 (Detailed summary)

Instelling
Vak









Oeps! We kunnen je document nu niet laden. Probeer het nog eens of neem contact op met support.

Gekoppeld boek

Geschreven voor

Instelling
Vak

Documentinformatie

Heel boek samengevat?
Ja
Geüpload op
20 april 2022
Aantal pagina's
11
Geschreven in
2021/2022
Type
Samenvatting

Onderwerpen

Voorbeeld van de inhoud

COS 132 Chapter 2



COS 132
CHAPTER 2 – INTRO TO C++
UNTI 2.1- THE PARTS OF A C++ PROGRAM




Line 2 #include <iostream>

Because this line starts w #, it is called a preprocessor directive. The preprocessor directive reads your program before it
is compiled and only executes those lines beginning w the symbol.

The #include directive causes the preprocessor to include the contents of another file (header file) in the program. It is
called the header file bc it should be included in the head of the program. <iostream> is the name of the header file that
is to be included.

Line 3 using namespace std;

This statement declares that the program will be accessing entities whose names are part of the namespace called std.

Line 5 int main()

This marks the beginning of a function, a function can be thought of as a group of one or more programming statements
that collectively has a name.

Line 7 cout << “Programming is great fun!”;

The group of characters inside the quotation marks is called a string lateral or string constant.

Line 8 return 0;




1|P a g e

, COS 132 Chapter 2

This sends the in value 0 back to the operating system upon the programs completion, the value indicates that a
program executed successfully.




UNIT 2.2 – THE COUT OBJECT

This is the simplest type of screen output that a program can display – console output which is just plain text.

Cout is classified as a stream object, which means it works w streams of data. To print a message on the screen, you
send a stream of characters to cout. When << operator is used in this way, it is called the stream insertion operator.
Think of it as an arrow that must point towards cout.

There are two ways to instruct cout to start a new line.

1. Send cout a stream manipulator called endl
- cout << “text” << endl;
2. Insert an escape sequence in the string itself, this starts w “\” and is follows by a control character
- cout << “text\n”;
- When using escape sequences, do not put a space between the backslash and the control character.




2|P a g e
€4,63
Krijg toegang tot het volledige document:

100% tevredenheidsgarantie
Direct beschikbaar na je betaling
Lees online óf als PDF
Geen vaste maandelijkse kosten


Ook beschikbaar in voordeelbundel

Maak kennis met de verkoper

Seller avatar
De reputatie van een verkoper is gebaseerd op het aantal documenten dat iemand tegen betaling verkocht heeft en de beoordelingen die voor die items ontvangen zijn. Er zijn drie niveau’s te onderscheiden: brons, zilver en goud. Hoe beter de reputatie, hoe meer de kwaliteit van zijn of haar werk te vertrouwen is.
jennamortonx IIE Varsity College
Volgen Je moet ingelogd zijn om studenten of vakken te kunnen volgen
Verkocht
18
Lid sinds
3 jaar
Aantal volgers
1
Documenten
49
Laatst verkocht
5 maanden geleden

4,0

1 beoordelingen

5
0
4
1
3
0
2
0
1
0

Recent door jou bekeken

Waarom studenten kiezen voor Stuvia

Gemaakt door medestudenten, geverifieerd door reviews

Kwaliteit die je kunt vertrouwen: geschreven door studenten die slaagden en beoordeeld door anderen die dit document gebruikten.

Niet tevreden? Kies een ander document

Geen zorgen! Je kunt voor hetzelfde geld direct een ander document kiezen dat beter past bij wat je zoekt.

Betaal zoals je wilt, start meteen met leren

Geen abonnement, geen verplichtingen. Betaal zoals je gewend bent via iDeal of creditcard en download je PDF-document meteen.

Student with book image

“Gekocht, gedownload en geslaagd. Zo makkelijk kan het dus zijn.”

Alisha Student

Veelgestelde vragen