error massage for new line at the end

Whenever i try to compile a perfactly working code in my compiler
Quincy 2005<‎>
I get following error message
error: no newline at end of file

However as soon as i add following code just ablove return 0; statement
program std::cout << "\n"; it compiles just fine
more interesting thing is that once if newline esquape character is added and
copiled then next time if you remove it and it would compile just fine.
is something wrong with my compiler setting
please help
Last edited on
C++ Standard [] declares:

... If a source file that is not empty does not end in a new-line character, or ends in a new-line character immediately preceded by a backslash character before any such splicing takes place, the behaviour is undefined.

so what am i supposed to do ?
1) Change compiler or upgrade is to better version.
2)OR just add cout << "\n"; at the end of every application

Topic archived. No new replies allowed.