#include <iostream> #include <stdio.h> using namespace std; main() { char a[10],b[10],c[20]; cout<<"\nPlease Enter Your Name : "; cin>>a; cout<<"\nPlease Enter Your Last Name : "; cin>>b; cout<<"\nPlease Enter Your Address : "; cin>>c; FILE *fp; fp=fopen("file.txt","w"); fputs(" Name: ",fp); fputs(a,fp); fputs(",",fp); fputs(" Last Name: ",fp); fputs(b,fp); fputs(",",fp); fputs(" Address: ",fp); fputs(c,fp); fclose(fp); }
store name,address in file
Post A Comment:
0 comments: