#include<iostream>
#include<fstream>
using namespace std;
void inputfile(char b)
{
ofstream myfile(b);
char c[100];
int a;
cout<<"enter your number :";
cin>>a;
cout<<endl<<"enter your First Name:";
cin.getline(c,100);
myfile<<a<<endl<<c;
myfile.close();
}
void outputfile(char b)
{
ifstream myfile(b);
char c[100];
int a;
myfile>>a>>c;
cout<<endl<<"your number is:"<<a<<endl;
cout<<"your First Name:"<<c;
myfile.close();
}
int main()
{
char c[100];
cout<<"Enter file Name:";
cin.getline(c,100);
inputfile((char *) &c);
outputfile((char *) &c);
return 0;
}
#include<fstream>
using namespace std;
void inputfile(char b)
{
ofstream myfile(b);
char c[100];
int a;
cout<<"enter your number :";
cin>>a;
cout<<endl<<"enter your First Name:";
cin.getline(c,100);
myfile<<a<<endl<<c;
myfile.close();
}
void outputfile(char b)
{
ifstream myfile(b);
char c[100];
int a;
myfile>>a>>c;
cout<<endl<<"your number is:"<<a<<endl;
cout<<"your First Name:"<<c;
myfile.close();
}
int main()
{
char c[100];
cout<<"Enter file Name:";
cin.getline(c,100);
inputfile((char *) &c);
outputfile((char *) &c);
return 0;
}
No comments:
Post a Comment