Uh...if this is C++, why are you using printf and scanf?
Try
1 2 3 4 5 6 7 8 9 10
#include <iostream>
#include <string>
int main()
{
std::string s;
std::cout << "String please: ";
std::getline(std::cin, s); // Or std::cin >> s; for one word only
std::cout << "Thanks for the " << s << "!\n";
}
Otherwise, if this is supposed to be C code, change the #include <cstdio> to #include <stdio.h> and try mutexe's suggestion above.
I am taking a free online course that uses C code. I want to eventually program in C++. I know I will run into problems because of the differences. However, I feel the effort is worth it. My understanding in taking this course is that you want to use library functions as much as possible.
It appears that C++ no longer supports printf and scanf but has similar fucntions like, printf_s and scanf_s. My assumption is that you can still use these functions; otherwise they would be deleted from the library.