“No newline at end of file” compiler warning

后端 未结 11 985
逝去的感伤
逝去的感伤 2020-11-27 09:50

What is the reason for the following warning in some C++ compilers?

No newline at end of file

Why should I have an empty line at

11条回答
  •  清酒与你
    2020-11-27 10:27

    That's not an error. It's just a warning.

    Open the file in an editor, go to the last line of the file, and hit enter to add a blank line to the end of the file.

    Though, besides that, you should be using #include instead of . Then put in a using std::cout; after it.

提交回复
热议问题