Tags: lec6

Q: Say you have x which is a const reference to an int.  Then you say "auto y = x;".  What things about the type does y consider/ignore?
A: y will be just an int -- auto ignores the fact that x is a constant and a reference.

Q: If p1 and p2 are pointers, how many bytes does p2 move forward relative to p1?
p2 = p1 + 1;
A: sizeof(*p1)

Q: What is a C-style string?  What about a C++ string?
A: A C style string is just an array of chars -- you don't get any nice string methods (like concatenation) with it.
A C++ string is represented by the std::string type.

Q: What is argv[0]?
int main(int argc, char* argv[])
A: The program name!  Command line arguments start from index 1.

Q: What is the difference between constexpr and const?
A: constexpr is computed at compile time, whereas a const variable is computed at runtime.