?

Log in

No account? Create an account

Previous Entry | Next Entry

A C++ quiz

Suppose I gave you the following snippets of code:

#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.

Latest Month

July 2011
S M T W T F S
     12
3456789
10111213141516
17181920212223
24252627282930
31      
Powered by LiveJournal.com
Designed by yoksel