Skip to content

Latest commit

 

History

History
47 lines (35 loc) · 787 Bytes

File metadata and controls

47 lines (35 loc) · 787 Bytes

Pre-test


1. What is the type of variable v?

int i = 42;
const auto v = &i;
  1. const int
  2. const int&
  3. const int*
  4. other

2. Which of the following initializations are valid in C++14?

struct P { int a, b };
  1. int values[] = { 1, 2, 3, 4, 5 };
  2. P v = { 1, 4 };
  3. P v{1, 4};
  4. P v(1, 4);
  5. std::vector<int> v = { 1, 2, 3, 4 };
  6. std::vector<int> v(1, 2, 3, 4);
  7. int v[] = { 1, 3, 5, 6.6 };

3. Which of the following elements can be defined as deleted (= delete;)?

  1. default constructor
  2. copy constructor
  3. move constructor
  4. copy assignment operator
  5. move assignment operator
  6. destructor
  7. free function
  8. class method
  9. class member object