Line break in code

Solved
teava Posted messages 3 Registration date   Status Membre -  
teava Posted messages 3 Registration date   Status Membre -
Hello everyone,
I am new to this forum and I am starting with C++.
I have some basics in programming in other languages, like Matlab.

So, here's my question:
How is it possible to create a line break in the code (and not in the program) to avoid writing long lines? In Matlab, we simply use the characters "..." at the end and the beginning of the next line.

Basically, I want to do something like:

cout << "blablabla\n [line break]
blablablablabla\n"

Instead of having:

cout << "blablabla\n blablablablabla\n"

Thank you for your help :)
Configuration: Windows XP Firefox 2.0.0.2

2 réponses

benkeeper Posted messages 81 Status Membre 45
 
However, please note that I haven't checked, but it seems to me that you shouldn't break a string in the middle.

For example, you should write:

cout << "bla bla bla " << "bla bla";


and not:

cout << "bla bla bla bla bla";


Ben
1
teava Posted messages 3 Registration date   Status Membre
 
Oh yes, that works too!

Thank you
0