You are viewing a single comment's thread. Return to all comments →
-Don't use 'printf' here, it's a C function. C++ is not C in any way. Use 'std::cout' instead.
-Never use 'using namespace std'. This directive has been added for compatibility purpose and can lead into multiple definitions in larger projects. It breaks the namespace principle. However, you can use it for literals (e.g. 'using namespace std::chrono_literals'). If you really don't want to use the 'std::' prefix, you can use 'using std::cout', 'using std::endl' and so on for each function, class, etc. you want to import in the global namespace.
std::cout << "Hello, World!" << std::endl;
And with 'using':
cout << "Hello, World!" << endl;