C++ Syntax (Toggle Plain Text)
#include <fstream>
#include <iostream>
int main()
{
ifstream is("filename");
int input;
if (is >> input)
std::cout << "Read " << input << '\n';
else
std::cout << "Couldn't read an integer\n";
}
#include <fstream>
#include <iostream>
int main()
{
ifstream is("filename");
int input;
if (is >> input)
std::cout << "Read " << input << '\n';
else
std::cout << "Couldn't read an integer\n";
}
0 comments:
Post a Comment