Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- int main()
- {
- std::ifstream f;
- f.exceptions(std::ifstream::failbit);
- try
- {
- f.open("ggg.txt", std::ios::binary);
- std::cout << "i'm bad" << std::endl;
- }
- catch (const std::ifstream::failure& e)
- {
- std::cout << e.what() << std::endl;
- }
- std::system("pause");
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement