명품 C++ programming 12장 실습문제 1번


명품 C++ programming 12장 실습문제 1번

문제 메모장을 이용하여 c:\temp\test.txt 파일을 다음과 같이 편집한 후, 이 파일을 읽어 출력하는 프로그램을 작성하라. <메모장> 0123456789 Integer 내가 짠 코드 #include<iostream>#include<fstream>#include<string>using namespace std;int main() { ofstream fout("c:\\temp\\test.txt"); if (!fout) { cout << "출력 스트림 연결 실패!" << endl; } ifstream fin("c:\\temp\\test.txt"); if (!fin) { cout << "입력 스트림 연결 실패!" << endl; } fout << "0123456789" << endl << "Integer" << endl; string line; while (getline(fin, line)) { cout <..........



원문링크 : 명품 C++ programming 12장 실습문제 1번