What I am trying to do is to get a string which is being assigned to by the cin command, and write it to a file. Now this is only working slightly. As the title says, the whole string is not being written to the file....only the first word:
1 2 3 4 5 6 7 8 9 10 11 12 13
string Text;
How I am writing to the file:
ofstream Write_Test("Write_Test.txt");//Creating the file
//Write_Test.open("Write_Test"); //Opening it for writing to, the ios::trunc at the end means it will open the file if it already exists, and overwrite any existing data with the new data.
Write_Test << Text; //Write a message to the file.
Write_Test.close(); //Close the stream, meaning the file will be saved.
cout << "Done!";
What I am using to assign the value 'Text' which is what I am writing to the text file:
cout << "Write something: ";
cin >> Text;