projects
/
akaros.git
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
VMM: Fix missed posted IRQs
[akaros.git]
/
tests
/
cpp_streams.cc
1
#include <iostream>
2
#include <fstream>
3
#include <string>
4
#include <errno.h>
5
6
using namespace std;
7
8
int main() {
9
string line;
10
ifstream myfile;
11
errno = 0;
12
myfile.open("hello.txt", ifstream::in);
13
if (errno)
14
perror("Unable to open (hello.txt):");
15
if (myfile.is_open()) {
16
while (myfile.good()) {
17
getline(myfile, line);
18
cout << line << endl;
19
}
20
myfile.close();
21
cout << "Stream test passed" << endl;
22
} else {
23
cout << "Unable to open file";
24
}
25
return 0;
26
}