As usual, before you can use printf you need to announce your intention via an #include declaration that tells the C++ compiler in which library printf resides:
printf
#include