Code:#include <stdio.h> main() { printf("hello world\n"); } why wont this work :( keeps telling me no newline at end of file but i thought this was "\n" am i wrong??
Code:#include <stdio.h> main() { printf("hello world\n"); } why wont this work :( keeps telling me no newline at end of file but i thought this was "\n" am i wrong??
End of file is probably where the last brace is, and you haven't got a newline on that line - I'm only guessing, as this sort of thing is hard to show here.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
Not having a new line at the end of the file shouldn't be a problem, the compiler just gives you a warning and adds the new line itself.
Vanity of vanities, saith the Preacher, vanity of vanities; all is vanity.
What profit hath a man of all his labour which he taketh under the sun?
All the rivers run into the sea; yet the sea is not full; unto the place from whence the rivers come, thither they return again.
For in much wisdom is much grief: and he that increaseth knowledge increaseth sorrow.
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
you mean
return 0;
?? still doesn't work
Thanks your right it just a warning but still works
You need a newline (if you press Ctrl-End on the keyboard, you should end up at the end of the file, and just make sure that's a "empty line" - the compiler will sometimes give this error for a line that contains a single space or tab.
--
Mats
Compilers can produce warnings - make the compiler programmers happy: Use them!
Please don't PM me for help - and no, I don't do help over instant messengers.
(Note the extra newline on the end.)Code:#include <stdio.h> int main() { printf("hello world\n"); } // Added to force board to show extra newline
Also remember to always use int main, not implicit main. http://cpwiki.sourceforge.net/Implicit_main