printf
and its sister function sprintf
are considered unsafe due to the amount of undefined behaviour they emit if used incorrectly.
Visual Studio is disabling these functions by default.
But, since they are part of the C++ standard library, you can use them. But Visual Studio will only allow you to do that if you include the line
#define _CRT_SECURE_NO_WARNINGS
before the relevant standard library headers are included.
Alternatively, include _CRT_SECURE_NO_WARNINGS
in your project preprocessor settings (which is what I do).
(By the way, Visual Studio is emitting a very helpful error message in this instance. Do try to learn to interpret them.)