Don't like ads? PRO users don't see any ads ;-)
Guest

Untitled

By: a guest on Apr 27th, 2012  |  syntax: None  |  size: 0.22 KB  |  hits: 14  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. Fastest way to read a text file of strings line by line [closed]
  2. std::ifstream file("file.txt");
  3. std::vector<std::string> lines;
  4. std::string line;
  5. while(std::getline(file,line))  //read line
  6.        lines.push_back(line);