#include <cstdio> void Class::PrintFoo() { printf("Foo\n"); } int main() { Class13 c13; c13.PrintFoo(); c13->PrintFoo(); return 0; }
Now write me the code for Class13, so this would compile, run, and print "Foo" twice. So far 50% of the people I have interviewed have given me the correct answer. For those that have dealt with smart pointers this should be trivial, for everyone else consider that a hint.