05-13 07:28
Notice
Recent Posts
Recent Comments
관리 메뉴

Scientific Computing & Data Science

[C/C++] Example / Writing a File 본문

Programming/C&C++

[C/C++] Example / Writing a File

cinema4dr12 2014. 6. 12. 10:43

//
//  main.cpp
//
//  Created by gchoi on 2014. 5. 8..
//  Copyright (c) 2014년 gchoi. All rights reserved.
//

#include <iostream>
#include <fstream>

using namespace std;

int main(int argc, const char * argv[])
{
    ofstream fout("{FILE_PATH}/test.txt");
   
    if(!fout) {
        cout << "can't open test.txt" << endl;
    }
   
    fout << "Welcome to C++" << endl;
    fout << "Hello World" << endl;
   
    fout.close();
   
    return 0;
}


Comments