txt2 c++ txt 파일 간단히 쓰기 #include #include int main() { // 파일을 이어쓰기 모드로 열기 std::ofstream file("파일이름.txt", std::ios::app); if (file.is_open()) { // 파일에 데이터 추가 file 2023. 10. 18. mfc 로그 폴더 생성 및 로그 txt 파일 만들기 void CMFCApplication1Dlg::OnBnClickedOk() { // TODO: 여기에 컨트롤 알림 처리기 코드를 추가합니다. CString strFilePath; strFilePath = "../LogLogLogLog22222/"; if (GetFileAttributes((LPCTSTR)strFilePath) ==-1) { // 디렉토리가 없으면 생성 CreateDirectory(strFilePath, NULL); } string line; std::string str = std::string(CT2CA(strFilePath)); str += "adge.txt"; ofstream file(str); if (file.is_open()) { file 2022. 5. 12. 이전 1 다음