learncpp Ch 1-6 & bit manipulation Flashcards
basics, functions, files, debugging, data types, operators, bit manipulation, scope, duration, and linkage
Statement
type of instruction that causes the program to perform some action. Statements are often terminated by a semicolon.
function
collection of statements that execute sequentially. Every C++ program must include a special function named main. When you run your program, execution starts at the top of the main function.
syntax
he rules that govern how elements of the C++ language are constructed
syntax error
occurs when you violate the grammatical rules of the language.
comments
allow the programmer to leave notes in the code. C++ supports two types of comments. Line comments start with a // and run to the end of the line. Block comments start with a /* and go to the paired */ symbol. Don’t nest block comments.
You can use comments to temporarily disable lines or sections of code. This is called commenting out your code.
data
any information that can be moved, processed, or stored by a computer.
value
A single piece of data, stored somewhere in memory
variable
named piece of memory that we can use to store values.
identifier
variable’s name
definition statement
In order to create a variable, we use a statement
instantiated
When the program is run, each defined variable is ___________, which means it is assigned a memory address.
data type
tells the compiler how to interpret a piece of data into a meaningful value.
integer
number that can be written without a fractional component, such as 4, 27, 0, -2, or -12.
copy assignment
(via operator=) can be used to assign an already created variable a value.
initialization
can be used to give a variable a value at the point of creation. C++ supports 3 types of initialization:
Copy initialization.
Direct initialization (also called parenthesis initialization).
List initialization (also called uniform initialization or brace initialization).
You should prefer brace initialization over the other initialization forms, and prefer initialization over assignment.
Although you can define multiple variables in a single statement, it’s better to define and initialize each variable on its own line, in a separate statement.
std::cout «
allow us to output an expression to the console as text.
std::endl
outputs a newline character, forcing the console cursor to move to the next line.
std::cin»_space;
allow us to get a value from the keyboard.
uninitializaed variable
A variable that has not been given a value
Trying to get the value of an uninitialized variable will result in _____ ______, which can manifest in any number of ways.
undefined behavior
keywords
These have special meaning within the language and may not be used as variable names.
literal constant
fixed value inserted directly into the source code. Examples are 5 and “Hello world!”.
operation
mathematical process involving zero or more input values, called operands.
The specific operation to be performed is denoted by the provided ______. The result of an operation produces an output value.
operator