May 14, 2002 #1 GabbeC Programmer May 14, 2002 1 SE Good morning. I wonder how I can print a .txt-file from my Visual C++ program. It's a log-file that automaticly should be printed, repeatetly. Greets GabbeC.
Good morning. I wonder how I can print a .txt-file from my Visual C++ program. It's a log-file that automaticly should be printed, repeatetly. Greets GabbeC.
May 14, 2002 #2 jtm111 Programmer Jun 27, 2001 103 US Try this, old sport: #pragma warning(disable:4786) #include <string> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { fstream in("c:\\FILENAME" string line; while (!in.eof()) { getline(in, line); cout << line; } in.close(); return 0; } Upvote 0 Downvote
Try this, old sport: #pragma warning(disable:4786) #include <string> #include <iostream> #include <fstream> using namespace std; int main(int argc, char *argv[]) { fstream in("c:\\FILENAME" string line; while (!in.eof()) { getline(in, line); cout << line; } in.close(); return 0; }