#include #include #include #include #include #include int main() { //From http://www.richelbilderbeek.nl/CppRunOtherProgram.htm //Silenty executes 'dir' and writes the output to the file "temp.txt" std::system("dir > temp.txt"); //Read "temp.txt" in a std::vector const std::vector file(FileToVector("temp.txt")); //Display the file typedef std::vector::const_iterator Iterator; for (Iterator i = file.begin(); i!=file.end(); ++i) { std::cout << *i << std::endl; } //Wait for key press std::cin.get(); }