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 (//)

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
What is the difference between standard and prestandard header files
Prestandard header files included a .h at the end. Example:
20
What follows #include
Preprocessor Directive
21
\r
Return (cursor to go to the beginning of the current line)
22
What does the include directive do
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
\t
horizontal tab (skips to next tab stop)
26
( ) (name and description)
Open and closing parentheses, Used in naming a function, as in int main()
28
what is the symbol for the include directive
(pound sign)
28
What is an example of a variable declaration / definiton?
int age;
30
What does a variable definition / declaration do?
Assigns an identifier to a location in memory (variable)
31
" "(name and description)
Open and closing quotation marks, Encloses a string of characters, such as a message to be printed on the screen.
33
\n
newline (cursor to next line)
34
(name and description)
Pound sign, Beginning of a preprocessor directive
36
; (name and description)
Semi colon, Marks the end of a complete programming statement.
37
What is an Identifier
Names for variables
38
Why is the header file included?
for input / output
40
what are the two ways to add a line
endl AND "\n" (use quotes for \n)
41
What do include for string
#include
42
// (name and description)
Double slash, Beginning of a comment
43
\b
Backspace (causes the cursor to move left one position)
44
What is iostream for?
Input and output
45
What can the first character of an identifier have to be?
letter or underscore
46
\< \> (name and description)
Open and closing brackets, Encloses a file-name when used with the # include