Gistrec icon

Read file to vector/string

Gistrec | PRO | 10/19/18 08:27:29 PM UTC | 0 ⭐ | 597 👁️ | Never ⏰ | []
C++ |

240 B

|

None

|

0 👍

/

0 👎

#include <vector>
#include <fstream>
#include <cassert>
#include <iterator>
 
vector<char> file;
 
std::ifstream input(fileName);
assert(input.good());
 
std::istream_iterator<char> start(input), end;
file.insert(file.begin(), start, end);

Comments

  •  icon
    01/01/70 12:00:00 AM UTC
    Plain Text |

    0 B

    |

    👍

    /

    👎