If you click "iostream", scroll down, click "cin", scroll down, click "istream" (sort of circuitous, but it follows the inheritance structure), you'll notice the method you want is just called "fail()". ;) There's a badbit and a failbit, presumably these are bitflags (get it?).

06-11-2010

Elysia

I like an alternative to MSDN, but where is std::array and std::shared_ptr!?!

06-11-2010

MK27

Quote:

Originally Posted by Elysia

I like an alternative to MSDN, but where is std::array and std::shared_ptr!?!

Good question, altho apparently these are not part of the current standard. Eg. Blarney Strnostr's book from last year ("Programming C++") does not mention them either.

But thanks for letting me in on std::array, sounds like a better vector ;)

06-11-2010

Elysia

They're part of TR1, and should be part of C++0x.
std::array is better than native C arrays. They are static arrays, and meant as a replacement for the C arrays (integrates better with the standard library and so on). Not a replacement for std::vector.