1/10
Looks like no tags are added yet.
Name | Mastery | Learn | Test | Matching | Spaced |
---|
No study sessions yet.
What is the << operator called in cout?
The stream insertion operator
What are the main C++ data types?
Integers, floats, text, boolean
What are escape sequences in C++?
\n = newline, \t = tab, \\ = backslash, \' = apostrophe
What happens if you exceed type limits?
Overflow/underflow
Why is hex used in debugging?
Memory is binary, but hex is shorter and easier to read
What are types?
Indicate how many bits/bytes of storage are required and how to interpret the number being stored
What are expressions in C++?
Combinations of variables, values, and operators. Examples:
Integer division: 5 / 2 = 2
Modulo: 5 % 2 = 1
What is casting?
Converting one type to another. Example: (double) 5/2 = 2.5
How do you generate random numbers?
srand(time(0)); // seed random
int r = rand(); // random int
RAND_MAX is the maximum random value.
Seeding:
srand(int seed) lets us make each run of generated numbers different
What are basic math functions in <cmath>?
pow(x,y), sqrt(x), sin(x), cos(x), abs(x)