The C++ compiler keeps saying "No newline at end of file" and raising the warning. Why should I enter at the end of the source/header file? It's not even an error. It's annoying and I don't feel like it. Does anyone know how to get rid of it?
c++ compiler-construction preprocessor warning
Considering the case of #include
of a file that did not open the last line in the ANSI standard,
Which header myheader.hpp
and
/*File myheader.hpp*/
//Some function~
// Which variable~
//He's commenting and didn't enter at the end
If there is a c++ file myheader.hpp
that includes this myheader.hpp
like this
/*File mycpp.cpp*/
#include "myheader.hpp"
int main() {}
If you compile this,
// Which function~
// Which variable~
//I'm commenting and didn't enter at the end int main() {}
Like this, the line immediately after the include can be annotated. If you don't warn them during the compilation phase, the programmer will ask people around you for help because my computer is weird.
The standard changes from C++11, so you don't have to worry about it It can be a difficult problem to find in a compiler under C++11, so please make sure to show the bottom line of the file
© 2024 OneMinuteCode. All rights reserved.