How to split long lines of code in c++?

后端 未结 5 895
盖世英雄少女心
盖世英雄少女心 2020-12-25 10:43

I need to make sure none of the lines in my code exceeds a a certain length.

Normally I separate lines where there\'s a comma or another suitable break.

How

5条回答
  •  悲哀的现实
    2020-12-25 11:41

    Two options:

    cout << "Error:This is a really long "
     << "error message that exceeds "
     << "the maximum permitted length.\n";
    

    Or:

    cout << "Error:This is a really long "
        "error message that exceeds "
        "the maximum permitted length.\n";
    

    The second one is more efficient.

提交回复
热议问题