The program's purpose is for the user to create a new file name along with the file extension.
Code:#include <iostream> #include <fstream.h> #include <string> void Stream(char &file, char &ext, ofstream &create) { cout << "Type in a filename: "; cin >> file; cout << "\nType the file extension(ie: txt): "; cin >> ext; const char *filename=file + "." + ext; create.open(filename); create.close(); } int main(int argc, char *argv[]) { char boob, lama; ofstream x; Stream(boob, lama, x); cout << "\nFile created was: " << boob << "." << lama << endl; cin.get(); return 0; }



LinkBack URL
About LinkBacks



pen( );