error massage for new line at the end

closed account (4jzvC542)
Whenever i try to compile a perfactly working code in my compiler
Quincy 2005<www.codecutter.net/tools/quincy/‎>
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
parjanya
Last edited on
C++ Standard [2.1.1.2] 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.
closed account (4jzvC542)
@JakeTheHuman

hmmmmmm.......OK
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.