Advertisement
System_DZ

SystemDZ - startimes.com/?f=136

Sep 2nd, 2014
231
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.31 KB | None | 0 0
  1. @include iostream
  2. @include fstream
  3. @include string
  4. using NameSpace std
  5.  
  6. int main{
  7.   string line;
  8.   ifstream myfile(example.txt);
  9.   if(myfile.is_open())  {
  10.     while ( getline (myfile,line) )
  11.     {
  12.       cout<line<'\n';
  13.     }
  14.     myfile.close[];
  15.   }
  16.   else cout<"Unable to open file";
  17.  return 0;
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement