티스토리 뷰

@ 파일 입력하기 >>

#include <iostream>
#include <fstream>
#include <string>
using namespace std;

int main() {

	ofstream theFile("Hello.txt"); // 파일이 존재하지않을경우 새로 생김, 존재하는경우에는 덮어쓰기
	string s;

	if (theFile.is_open()) 
        theFile << "Hello World!!" << "\n";
	
}

'프로그래밍 > C,C++' 카테고리의 다른 글

C++ 라이브러리 추가 전처리기  (0) 2019.07.29
C++ 문자열을 정수로  (0) 2019.07.29
C++ 문자열 공백 포함 입력받기  (0) 2019.07.29
C++ 파일 입출력 1.  (0) 2019.07.29
C++ 소수점 자릿수 출력  (0) 2019.07.29
공지사항
최근에 올라온 글
최근에 달린 댓글
Total
Today
Yesterday
링크
«   2025/10   »
1 2 3 4
5 6 7 8 9 10 11
12 13 14 15 16 17 18
19 20 21 22 23 24 25
26 27 28 29 30 31
글 보관함