Skip to content

Commit

Permalink
don't need close the fstream
Browse files Browse the repository at this point in the history
  • Loading branch information
pezy committed Dec 14, 2014
1 parent 34067c5 commit 8f46c2a
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 5 deletions.
2 changes: 1 addition & 1 deletion ch10/ex10_29.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ int main()
std::istream_iterator<string> in(ifs), eof;
std::vector<string> vec;
std::copy(in, eof, back_inserter(vec));
ifs.close();

// output
std::copy(vec.cbegin(), vec.cend(), std::ostream_iterator<string>(std::cout, "\n"));
}
4 changes: 0 additions & 4 deletions ch10/ex10_33.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,5 @@ int main(int argc, char **argv)
*(i&0x1 ? out_odd : out_even)++ = i;
});

ifs.close();
ofs_odd.close();
ofs_even.close();

return 0;
}

0 comments on commit 8f46c2a

Please sign in to comment.