To ensure readability I want to keep the type names as short as possible. Below are 4 versions of a trivial code. What is the best practice to adopt? Are there even better ones?
Version a:
#include <iostream>
main ()
{
::std::string s;
s = "hello";
::std::cout << s << ::std::endl;
}
Version b:
#include <iostream>
main ()
{
std::string s;
s = "hello";
std::cout << s << std::endl;
}
Version c:
#include <iostream>
using namespace std;
main ()
{
string s;
s = "hello";
cout << s << endl;
}
Version d:
#include <iostream>
main ()
{
using namespace std;
string s;
s = "hello";
cout << s << endl;
}