We are trying to make the console type what the user inputs but when the user uses a space it only uses what is before the space.
our code is:
#include <iostream>
#include <cmath>
int main()
{
using namespace std;
cout << "What do you want to spam?(no spaces)" << endl;
int x;
char input[20];
cin >> input;
for (x=0;x<2147000000;x++)
cout << input;
system("pause");
return 0;
}
also, help on getting it to work on microsoft word would help too. we are using the Dev C++ compiler.
If you mean making it into a word document, then this would be non trivial, and require an 3rd party library, possibly proprietary.
On the other hand, you are happy to make it into a plain text file, you could use <fstream>. Then you can write to a file pretty much as easily as writing to standard output, cout. Read about <fstream> and files in C++ here: http://cplusplus.com/doc/tutorial/files/.
If this isn't what you mean then feel free to ignore this post. If on the other hand, it is, bear in mind that the file created would be length_of_user_input times 2 billion, i.e. a five character input would (I think) result in a 10GB file.
If you really are going to write that to a file, I very much recommend you reduce the loop count to maybe a few hundred. As I said, the resulting file is going to be *huge* if you write the string to it 2 billion times.