std::cin, std::cout, peek, ws

Im going through my class notes online and my professor talks about ws and peek but i don't exactly know what it means. to my understanding, its used with cin, ws is used to get all the whitespaces the person using he program enters, but i don't know what peek is for.

as for the std::bout and std::cin, again to the best of m understanding, they're used when the programmer is using if else statements right? but again, i don't know what they are for
Did you try to look up these functions in a search engine? Try looking for "c++ peek" in a search engine. You should be able to find some documentation for this function.

Here is some documentation for ws: http://www.cplusplus.com/reference/istream/ws/

I really don't understand your second paragraph. But if you are talking about the "std::" that appears before the cin statement, that is one of the ways to scope functions in the standard (std) namespace. You may want to search for some more information for C++ namespaces.


std::cout is for output (C++ OUTput) to the console window, like in the hello world program.

std::cin is for input (C++ INput) from the user in the console window.

(note: technically they're just for input/output and don't care whether there is a console window or not, but most of the time you will be dealing with the console for small test programs)
Topic archived. No new replies allowed.