HOW TO CREATE FILES...

HI EVERYBODY,

I AM NEW MEMBER,

I NEED A LITTLE HELP

HOW CAN I WRITE A PROGRAM THA READS A NAME FROM KEYBOARD AND CREATES
A TEXT FILE OF THAT NAME

HOPE TO GET REPLY SOON

GOOD DAY
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
//This program creates a text file of the name, which your enter from keyboard!
#include<iostream>
#include<fstream>
using namespace std;

int main()
{	
	ofstream out;
	char out_file_name[16];//16 is your file's name length (in characters)
	cin>>out_file_name;
	out.open(out_file_name);
	

	
	out.close();
	return 0;
}

thanks gogo
Topic archived. No new replies allowed.