Im new to C++, I no some basic, but changed language because basic was a bit too basic, anyway, I have a problem when making i/o files. I think the problem is the way that I open the files, because I use the "std::cin >> details;" and "cin.getline(details,256,'\n');" and "a_file << details;" in the source code, but when u try and open the file, it only shows the first word in the file. This is part of my source code, please tell me what you would do in this position...
WHEN MAKING THE FILE:-
Code:
void
create ()
{
cout << " Please enter the ID number that you want to" << endl;
cout << " Assign to this candidate" << endl;
cout << " Candidate reference number:";
cin >> ID;
ofstream a_file(ID);
cout << "" << endl;
cout << " Please input the data that you want to hold about this client" << endl;
cout << " Please begin the entry with a // and a space before typing" << endl;
cout << " in your database entry" << endl;
cout << " Please input the data here..." << endl;
cout << "" << endl;
std::cin >> details;
cin.getline(details,256,'\n');
a_file << details;
CODE WHEN OPENING THE FILE:-
Code:
void
view ()
{
cout << "" << endl;
cout << " Please enter the reference number of the database file:" << endl;
cin >> ID;
cout << "" << endl;
ifstream b_file(ID);
cout << "" << endl;
b_file >> details;
cout << details;
Any ideas...