Ok...I have a problem with fstream. When ever you type in a space when you type what you want in the fstream generated file, the first word only comes out. For example, my sample code, compiles but it only shows the first word:
#include <iostream.h>
#include <fstream.h>
int main(void)
{
char paragraph[20];
cout << "Enter a sentence:";
cin >> paragraph;
ofstream a_file (test.txt);
a_file << "Your Paragraph is:" << endl
<< paragraph;
return 0;
}
Why is this? Someone Please Help. Thanks in advance.