void foo() { Zulu<double> p = new double; … // use p here … // expect the memory to be freed }
Instead of Zulu
, which one of these would be best?
auto_ptr
shared_ptr
stack_ptr
unique_ptr
Trick question—smart pointers have explicit
ctors, so you need to use the parenthetical ctor notation. This won’t compile.
void foo() { Zulu<double> p(new double); … // use p here … // expect the memory to be freed }
Instead of Zulu
, which one of these would be best?
auto_ptr
shared_ptr
stack_ptr
unique_ptr
Which of these puts the symbol string
into the global namespace?
#include <string.h>
#include <string>
#include <cstring>
#include <ᵷuᴉɹʇs>
Which of these will skip whitespace before the value?
char v; if (cin >> v) …
char v; if (cin.get(v)) …
int v; if (cin >> v) …
string v; if (getline(cin, v)) …
string v; if (cin >> v) …
cout << hex << right << showbase << showpoint << showpos << uppercase << 0123 << endl;
What will this code produce?