thenuke321

Untitled

Feb 23rd, 2015
284
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 0.45 KB | None | 0 0
  1.  
  2. //Read’s data
  3. string readAllDataFromFile(string theFileName)
  4. {
  5.     string *fileName = new string;
  6.     *fileName = theFileName;
  7.     string *theOutData =  new string;
  8.     ifstream fileIn;
  9.     fileIn.open(*fileName, ios::in | ios::binary);
  10.     {
  11.         string str((istreambuf_iterator<char>(fileIn)), istreambuf_iterator<char>());
  12.         *theOutData = str;
  13.         fileIn.close();
  14.  
  15.         str.resize(10);
  16.         str.shrink_to_fit();
  17.     }
  18.     delete(fileName);
  19.     return *theOutData;
  20. }
Advertisement
Add Comment
Please, Sign In to add comment