반응형 ifstream1 [C++] 파일 입출력 간단한 예제(ofstream, ifstream) c++에서 간단하게 txt파일에 글을 쓰고 읽어오는 예제다. "입력 문자 입니다." 라는 문자열을 file.txt 메모장에 쓰고 이 파일을 다시 읽어오는 예제다. #include "fstream" #include "iostream" #include "string" using namespace std; int main() { string str = "입력 문자 입니다."; ofstream ofs("file.txt"); ofs 2023. 11. 10. 이전 1 다음 반응형