Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #include <iostream>
- #include <fstream>
- int main()
- {
- std::ifstream file("numbers.txt", std::ios::in);
- if (!file)
- {
- std::cerr << "Can't open file\n";
- return 1;
- }
- char ch;
- while (!file.eof())
- {
- file.get(ch);
- if (!file.good() && !file.eof())
- {
- std::cout << "I/O error!\n";
- return 1;
- }
- std::cout << ch;
- }
- std::cout<<std::endl;
- return 0;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement