C++ Flashcards

1
Q

Console Program

A

Use text to communicate with the user and to show their results

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

//

A

Line comment. All lines beginning with “//” are considered comments and do not have any effect on the behavior of the program. Used to include short explanations or observations within the source code itself.

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

#

A

Liens beginning with a # are directives for the preprocessor. They are indications for the compiler’s preprocessor.

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

int main ()

A

This line corresponds to the beginning of the definition of the main function. The main function is the point by where all C++ programs start their execution, independently of its location within the source code.

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

{ }

A

What the function does when it is executed.

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

cout &laquo_space;” “

A

represents the standards output stream in C++, and the meaning of the entire statement is to insert a sequence of characters into the standard output stream

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

;

A

This character is used to mark the end of the statement and in fact it must be included at the end of all expression statements in all C++ programs

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

return 0

A

The return statement causes the main function to finish. return may be followed by a return code. A return code of 0 for the main function is generally interpreted as the program worked as expected without any errors during its execution.

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

/* */

A

Block Comment discards everything between the * characters and the first appearance the */ characters, with the possibility of including more than one line.

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

A valid identifier is…

A

A valid identifier is a sequence of one or more letters, digits or underscore characters (_). Neither spaces for punctuation marks or symbols can be part of an identifier.

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

Is C++ case sensitive?

A

yes

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

char

A

Character or small integer (1 byte)

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

short int (short)

A

Short Integer (2 bytes)

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

int

A

Integer (4 bytes)

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

long int (long)

A

Long integer (4 bytes)

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

bool

A

Boolean value. It can take one of two values: true or false. (1 byte)

17
Q

float

A

Floating point number (4 bytes)

18
Q

double

A

Double precision floating point number (8 bytes)

19
Q

long double

A

Long double precision floating point number (8 bytes)

20
Q

wchar_t

A

Wide character (2 -or- 4 bytes)

21
Q

Global Variable

A

A variable declared in the main body of the source code, outside all functions

22
Q

Local Variable

A

A variable declared within the body of a function or a block