Week 2 (Intro to C++) Flashcards

1
Q

What is the std namespace

A

namespace for iostream

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
1
Q

\a

A

alarm (beep)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

When are semi colons to be used

A

At the end of complete statements

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What does the return of the main function do?

A

sends integer value 0 when program executed successfully

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

{ }(name and description)`

A

Open and closing braces, Encloses a group of statements such as the contents of a function

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What denotes the beginning of a function

A

() for argument followed by a {

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

what type of object is the cout object

A

stream object

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What are constants

A

data items, values can not change

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

what is the << called

A

Steam insertion operator

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the skeleton for definition / declaration:

A

dataType variableName(identifier) ;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

What is the keyword for a boolean

A

bool

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Syntax for an Assignment Statement

A

variableName = expression;

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

How do you not confuse double long with int long

A

add L to the end of the floating point number

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What are Variables

A

storage locations in memory

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is the skeleton of a function

A

returnType functionName () { }

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

When does a preprocessor directive act?

A

Before you compile

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

what operator can determine size?

A

sizeof()

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

What is a return type

A

type of value function sends back when done executing

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What does a namespace do?

A

Organize names for variables, functions, and objects

15
Q

What is an assignment statement

A

Sores a value in a variable

17
Q

What follows a double slash (//)

A

Comment

18
Q

What does a preprocessor directive do?

A

“Sets up” your source code (Header File)

18
Q

What is the text inside double quotes called

A

String Literal

18
Q

What happens when you put a double into an integer?

A

Truncate, loss of data.

19
Q

What is the difference between standard and prestandard header files

A

Prestandard header files included a .h at the end. Example:

20
Q

What follows #include

A

Preprocessor Directive

21
Q

\r

A

Return (cursor to go to the beginning of the current line)

22
Q

What does the include directive do

A

causes another file to be inserted into your program (not part of C++ core language, not seen by C++, commands to preprocessor, no semi colon)

24
Q

\t

A

horizontal tab (skips to next tab stop)

26
Q

( ) (name and description)

A

Open and closing parentheses, Used in naming a function, as in int main()

28
Q

what is the symbol for the include directive

A

(pound sign)

28
Q

What is an example of a variable declaration / definiton?

A

int age;

30
Q

What does a variable definition / declaration do?

A

Assigns an identifier to a location in memory (variable)

31
Q

” “(name and description)

A

Open and closing quotation marks, Encloses a string of characters, such as a message to be printed on the screen.

33
Q

\n

A

newline (cursor to next line)

34
Q

(name and description)

A

Pound sign, Beginning of a preprocessor directive

36
Q

; (name and description)

A

Semi colon, Marks the end of a complete programming statement.

37
Q

What is an Identifier

A

Names for variables

38
Q

Why is the header file included?

A

for input / output

40
Q

what are the two ways to add a line

A

endl AND “\n” (use quotes for \n)

41
Q

What do include for string

A

include

42
Q

// (name and description)

A

Double slash, Beginning of a comment

43
Q

\b

A

Backspace (causes the cursor to move left one position)

44
Q

What is iostream for?

A

Input and output

45
Q

What can the first character of an identifier have to be?

A

letter or underscore

46
Q

< > (name and description)

A

Open and closing brackets, Encloses a file-name when used with the # include