Chapter 2 ( Introductions to C++ Programming, Input/Output, and Operators )

Pataasin ang iyong marka sa homework at exams ngayon gamit ang Quizwiz!

Comments

Ignored by compiler. Causes no actions to occur.

Statement Terminator (;)

Most C++ statements end iwth a semicolon.

#include <iostream>

Tells the C++ preprocessor to include the contents of the input/output stream header, which contains information necessary to compile programs that output data to the screen or input data from the keyboard.

Escape Sequence

When a backslash is encountered in a string of characters, the next character is combined with the backslash to form an escape sequence.

Prompt

A message that directs the user to take a specific action.

String

A string in " Double Quotes" is sometimes referred to as a character string, message or string literal. White space-characters in strings are not ignored by the compiler.

Memory

A variable is a location in memory where a value can be stored for use by a program. Every variable stored in the computer's memory has a name, a value, a type and a size.

Variables

All variables must be declared before they can be used.

Single-line comments

Begin with ( // ). Insert comments to document your programs and improve their readability.

Preprocessing Directive

Begins with ( # ) and is a message to the C++ preprocessor. Preprocessing directives are processed before the program is compiled.

Return Function

C++ keyword that means to exit a function.

Main Function

C++ programs begin executing at main, even if main does not appear first in the program.

White space ( Blank lines, space characters and tab characters )

Makes programs easier to read. White-space characters outside of string literals are ignored by the compiler.

Newline Escape Sequence ( \n )

Moves the cursor to the beginning of the next line on the screen.

Streams

Output and inputs in C++ are accomplished with streams of data.

Body

The body of every function must be contained in braces ( { and } ).

std::cout

The output stream object normally connected to the screen is used to output data. Multiple data items can be output by concatenating stream insertion (<<) operators.

List Initialization

The variable's initial value is placed in braces ( { and } ) immediately following the variable's name.


Kaugnay na mga set ng pag-aaral

Marketing 3343 Six Steps In Pricing Strategy Process

View Set

"Old Man at the Bridge" by Ernest Hemingway - 9th Grade English Midterm [201-202]

View Set

13 Skeletal and muscular systems

View Set

type of insurance policies and provisions, options, and riders

View Set

Acct 381 Federal Income Tax Individuals

View Set

Chapter 40: The Sonographic and Doppler Evaluation of the Female Pelvis

View Set