Tuesday 30 October 2018

c++ - Using std Namespace

There seem to be different views on using 'using' with respect to the std namespace.



Some say use ' using namespace std', other say don't but rather prefix std functions that are to be used with ' std::' whilst others say use something like this:



using std::string;
using std::cout;
using std::cin;
using std::endl;
using std::vector;


for all the std functions that are to be used.



What are the pros and cons of each?

No comments:

Post a Comment

php - file_get_contents shows unexpected output while reading a file

I want to output an inline jpg image as a base64 encoded string, however when I do this : $contents = file_get_contents($filename); print &q...