Hello MrLostProphet,
After a month or so of reading about how
using namespace std;
is a bad idea I started learning what is in the standard name space and how to qualify it.
The first thing you need to understand is that using
using namespace std;
in the global scope of the file means that when compiled the compiler tries to put "std::" in front of everything and if something you wrote, either a variable name or a function, happens to be in the standard name space it will put "std::" in front of it ans use what is in the standard name space and not what you wrote.
This is worth reading:
http://www.cplusplus.com/doc/tutorial/namespaces/
Although it point is a bit different I would consider this a must read:
http://www.lonecpluspluscoder.com/2012/09/22/i-dont-want-to-see-another-using-namespace-xxx-in-a-header-file-ever-again/ Look closely at the parts about the using statements, i.e., "using std::cout" etc.
The statement "std::cin.ignore" is simple enough. Whether you use the "std::" or not the ".ignore" is a part of the "iostream" that you included. It may not come directly from "iostream", but from other header files that "iostream" includes.
Inside the () the first part,
(std::numeric_limits<std::streamsize>::max(), '\n')
, is just giving this a very large number. It could be replaced with "1000" or "100000 ". What is there is just using the largest number possible for your computer and compiler as header files have set for this.
The second part,
(std::numeric_limits<std::streamsize>::max(), '\n')
, is a character it looks for.
The whole thing together says to ignore characters in the input buffer up to this very large number or the new line character whichever comes first.
The nice thing about C++ is that you do not always have to know how something works right away just how to use it.
Read enough around here and you will see this or something like it quite often.
As far as the "std::" part I am just use to typing it without thinking and I nolonger use the line
using namespace std;
in my programs.
Hope that helps,
Andy