C++ Notes

0.0(0)
Studied by 0 people
call kaiCall Kai
learnLearn
examPractice Test
spaced repetitionSpaced Repetition
heart puzzleMatch
flashcardsFlashcards
GameKnowt Play
Card Sorting

1/53

encourage image

There's no tags or description

Looks like no tags are added yet.

Last updated 1:40 AM on 3/22/26
Name
Mastery
Learn
Test
Matching
Spaced
Call with Kai

No analytics yet

Send a link to your students to track their progress

54 Terms

1
New cards

What does initialized mean?

It means an object is given a known value at the point of definition.

2
New cards

What does assignment mean?

It means an object is given a known value beyond the point of definition.

3
New cards

What does uninitialized mean?

It means an object has not been given a known value yet.

4
New cards

What is an uninitialized variable?

A variable that has not been give a value by the program(generally through initialization or assignment).

5
New cards

Why should you avoid using a uninitialized variable

Using this value will result in undefined behavior.

6
New cards

What is undefined behavior?

It is the result of executing code whose behavior is not well defined by the language. The result can be almost anything, including something that behaves correctly.

7
New cards

Implementation-defined behavior

Behavior chosen by the compiler and documented (consistent per compiler, may differ across compilers)

8
New cards

Unspecified behavior

Behavior chosen by the compiler but not documented (can vary, unpredictable)

9
New cards

Identifier

The name of a variable(or function, type, or other kind of item)

10
New cards

Identifier naming rules

  • The identifier can not be a keyword. Keywords are reserved.

  • The identifier can only be composed of letters (lower or upper case), numbers, and the underscore character. That means the name can not contain symbols (except the underscore) nor whitespace (spaces or tabs).

  • The identifier must begin with a letter (lower or upper case) or an underscore. It can not start with a number.

  • C++ is case sensitive, and thus distinguishes between lower and upper case letters. nvalue is different than nValue is different than NVALUE.

11
New cards

What is a literal (also known as a literal constant)?

A fixed value that has been inserted directly into the source code.

12
New cards

What is an operation?

A process involving zero or more input values that produce a new value

13
New cards

What is operands?

Zero or more input values.

14
New cards

What is an operator?

The denoted symbol that a specific operation is to be performed with.

15
New cards

What is an arity?

The number of operands that an operator takes as input.

16
New cards

Unary operator

An operator that works on a single operand.

17
New cards

Binary operator

An operator that works on two operands.

18
New cards

Ternary operator(there is only one)

An operator that works on three operands.

19
New cards

Nullary operator (there is only one)

An operator that works on zero operands.

20
New cards

What is an expression?

A non-empty sequence of literals, variables, operators, and function calls that calculates a value.

21
New cards

What is an evaluation?

The process of executing an expression.

22
New cards

What is a Return Value (also know as a return)?

The resulting value produced from a evaluation.

23
New cards

What is an expression statement?

A statement that consist of an expression followed by a semicolon.

24
New cards

What is a side effect? (typically seen with operators)

Some observable effect beyond producing a return value.

25
New cards

What is a subexpression?

An expression used as an operand.

26
New cards

What is a full expression?

An expression that is not a subexpression.

27
New cards

What is a compound expression?

An expression that contains two or more uses of operators.

28
New cards

What is a statement?

A type of instruction that causes the program to perform some action

29
New cards

What symbol ends a statement?

A semicolon (‘;‘)

30
New cards

What is a function?

A collection of statements that execute sequentially.

31
New cards

What is syntax?

The rules that govern how elements of the C++ language are constructed.

32
New cards

When does a syntax error occur?

When you violate the grammatical rules of the language.

33
New cards

What do comments do?

They allow the programmer to leave notes in the code.

34
New cards

What should a comment say at the library, program, or functions definition level?

These comments will describe what the library, program, or function does.

35
New cards

What should a comment say within a library, program, or function?

The comment should describe how the code is going to accomplish its goal.

36
New cards

What should a comment say at the statement level?

The comment should explain why the code is doing something.

37
New cards

What is a variable?

A named piece of memory(an object) that we can use to store values.

38
New cards

What is a definition statement used for?

It is used to create a variable, defining both its type and identifier.

39
New cards

What does instantiated mean?

It means it has been assigned a memory address.

40
New cards

What is a data type used for?

It is a way for the compiler to determine what kind of value a object will store.

41
New cards

What is an object (memory)?

It is a region in storage that can hold a value.

42
New cards

What is Random Access Memory (often called RAM for short)?

It is the main memory in a computer.

43
New cards

What is a value (sometimes called a data value)?

It is a single piece of data.

44
New cards

What is data?

It is any information that can be moved, processed, or stored by a computer.

45
New cards

What does default-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x;

46
New cards

What does copy-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x = 5;

47
New cards

What does direct-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x (5);

48
New cards

What does direct-list-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x { 5 };

49
New cards

What does copy-list-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x = { 5 };

50
New cards

What does value-initialization look like (if there is a type use int, if there is a identifier use ‘x‘, and if there is a value use ‘5‘)?

int x {};

51
New cards

What does std::cout and operator« allow us to do?

It allows us to output the result of and expression to the console.

52
New cards

What does std::endl allow us to do?

It allows us to output a newline character, and flushes any pending output to the console.

53
New cards

What does std::cin and operator» allow us to do?

It allows us to get a value from the keyboard.

54
New cards

What are keywords?

Its a set of names that C++ reserves. These words have special meanings withing the language and may not be used as variable names.

Explore top flashcards

flashcards
Microscopic examination CASTS
34
Updated 657d ago
0.0(0)
flashcards
Zoology Exam 1
145
Updated 45d ago
0.0(0)
flashcards
Med Micro Case Studies
76
Updated 1196d ago
0.0(0)
flashcards
Y2 U1L1 Vamos a acampar
55
Updated 915d ago
0.0(0)
flashcards
Modern World History Midterm
51
Updated 205d ago
0.0(0)
flashcards
World History Exam
232
Updated 1033d ago
0.0(0)
flashcards
Concept of Globalization
22
Updated 1141d ago
0.0(0)
flashcards
Microscopic examination CASTS
34
Updated 657d ago
0.0(0)
flashcards
Zoology Exam 1
145
Updated 45d ago
0.0(0)
flashcards
Med Micro Case Studies
76
Updated 1196d ago
0.0(0)
flashcards
Y2 U1L1 Vamos a acampar
55
Updated 915d ago
0.0(0)
flashcards
Modern World History Midterm
51
Updated 205d ago
0.0(0)
flashcards
World History Exam
232
Updated 1033d ago
0.0(0)
flashcards
Concept of Globalization
22
Updated 1141d ago
0.0(0)