Hey, Currently I making a little program that takes: Clients name and then the tracking code for that client and saves it in a 'char array'
However, my following code is not producing a file:
Code:#include <iostream> #include <fstream> #include <string.h> using namespace std; int main() { ofstream firstClass; char cname[25]; char trackno[14]; char outFileName[256]; int z; cout <<"Enter the client name: "; cin >> cname; cout <<"Okay, Thats saved..." << endl; cout <<" " << endl; cout <<"Please now enter the tracking code: "; cin >> trackno; cout << "Set the output file name: "; cin.getline(outFileName,256); firstClass.open(outFileName); firstClass << trackno; firstClass.close(); cin >> z; return 0; }



LinkBack URL
About LinkBacks



