Students are allowed a single (standard-sized) page of notes, double-sided, typed or hand-written. You cannot simply create a verbatim copy of my notes; you must select key bits of pages and/or write significant parts yourself. You will be required to turn in the page at the end of the exam.
double a, *b, **c; b = &a; c = & b; **c = 1.2;
const
void p(const int &x); p(3);
double that takes a value (of any
type) and returns that value added to itself without changing the
value. Write a fragment of code applying double to some
declared, initialize variable, where the type of the variable is in
namespace std.
names that is an
array of pointers to std::string values. Allow up to 20
names. Set the first name to your own name, but all of the rest should
be nullptr.
struct to create an array that is passed by
value.
void dosomething(int
nums[]); and write int s = sizeof(nums); in the
body. What does this set s to? Is there a way to change
the declaration of nums so s gets a different
value?
char *p, knowing the difference
between p, *p, and &p
[]
nullptr
int xs[100]; (depending on where declared)
#define, dangers of using #define instead of templates
#if ... #else ... #endif
union - know what it means, you will not have to write
coding using it
auto x = a;
vs. x = b;.
std::string x;, risk of storing x.c_str() in
a variable/object
=delete to suppress assignment operator, copy
constructor, move operator
istream, ostream by reference
while ( ! eof ) { read; process }
is a bad idea
istringstream and ostringstream:
convert other data types into strings or from strings
ifstream to read files, ofstream to write
.close as an optional operation for C++ files
std::string
list<string>::iterator pos = todo.begin(),
pos != todo.end()
for(auto const & x :
items), for(auto x : items),
for(auto & x : items),
static_cast and dynamic_cast
const_cast
malloc and free
int8_t, int16_t, etc.
void* means, how used in C