0

What im wondering, is because im making a little text adventure game, and i have to write lots of descriptive writing and i would like it all to stay together in a paragraph. But the only way of getting that on output that i know of is to just have one realy, realy long cout.

like this.

cout << "You enter the cave as a monster apears blah blah blah and it just goes on and doesn't look nice in the compiler." << endl;

Of course in the compiler it doesn't go to the next line like here, which is what im looking for. A way to continue the cout or do a new cout without a break.

Anywhoo any help would be greatly appreciated with this. cause i badly need a way to clean up.
Cheers.:icon_cheesygrin:

3
Contributors
3
Replies
5
Views
10 Years
Discussion Span
Last Post by someguy88
0

You can add \n to the out put and it will put it on a new line. as in:

cout << "You enter the cave as a monster apears\n blah blah blah and\n it just goes on and doesn't look nice in the compiler." << endl;

it will show up as,

You enter the cave as a monster apears
blah blah blah and
it just goes on and doesn't look nice in the compiler.

0

In C and C++ string concatenation of adjacent string literals is automatic.

cout << "You enter the cave as a monster apears "
           "blah blah blah and it just goes on and "
           "doesn't look nice in the compiler." << endl;
0

Thanks so much both of you, cheers. that second one was just what i was looking for, hope it works.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.