I am newly learning C++, I do not really understand the difference between putting using std::string vs #include <string> at the top of my main file.
I seem to be able to define strings without having #include <string> here:
#include <iostream>
using std::cout; using std::cin;
using std::endl;
using std::string;
int main()
{
string s = "hi";
cout << s;
return 0;
}
This seems to run without issue, so why would I have #include <string>?