I have been using Dev-Cpp compiler and have just switched to Code::Blocks
My code compiles just fine with Dev-Cpp, but code blocks gives me a "no new line at end of file warning"
What is that?
I have been using Dev-Cpp compiler and have just switched to Code::Blocks
My code compiles just fine with Dev-Cpp, but code blocks gives me a "no new line at end of file warning"
What is that?
it isnt a problem it is just saying there isnt a newline at the end of your source files. Also, if you have an up to date version of code::blocks, it will add the newline automatically.
The OP probably took the source file verbatim from Dev-C++ and compiled it with Code::Blocks. I don't think that Dev-C++ automatically adds newlines to the ends of files.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Something vague in my memory tells me it might even be a requirement from the C++ standard that all source files end with a newline. I have no idea if that is correct, though.
It's likely, since GCC gives that warning even in ANSI mode. Yep.
http://www.thescripts.com/forum/thread444292.html"The ISO C standard, section 5.1.1.2, states that source files must end with
new lines."
Not sure about the C++ standard, but it would make sense that it requires it too.
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.
Yes i have faced this too! Hit some enters at the last line and then compile! I think that will do!
Thanks...