Skip to content

Instantly share code, notes, and snippets.

@ahmedahamid
Created January 2, 2016 03:53
Show Gist options
  • Save ahmedahamid/4c88000c60791ff9096c to your computer and use it in GitHub Desktop.
Save ahmedahamid/4c88000c60791ff9096c to your computer and use it in GitHub Desktop.
#include <string>
#include <fstream>
int main() {
std::ifstream input_file("/etc/passwd");
if (input_file)
{
std::string line;
while(std::getline(input_file, line))
{
// do something with @line
}
}
return 0;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment