Jump to content
  • Advertisement
Sign in to follow this  
drjulio2002

Still problem with "no newline at end of file"

This topic is 5017 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

Hello everyone! I can't eliminate this error [Warning] no newline at end of file / with Dev- C++ 4.9.9.1. Please help, it will be appreciated! http://www.geocities.com/drjulio2001 Julio Cruz

Share this post


Link to post
Share on other sites
Advertisement
make sure that at the end of every file there is a newline. a newline is just an empty line.

furthermore, it's just a warning, so you can safely ignore it if you wish. cheers.

Share this post


Link to post
Share on other sites
I have a soluction to this problem with Dev- C++ [Warning] no newline at end of file! problem. Most of us know that when we make a new source file; it is a blank page right, well, if you go to Tools->Editors Options->Code Tab->Default Source Tab of the bottom of that page we could set up the source code you want to appear when you click [New Source] bottom in Dev- C++. If you do this it well solve the problem!


#include <stdio.h>

int main()
{

system("PAUSE");
return 0;
}



or


#include <cstdlib>
#include <iostream>

using namespace std;

int main(int argc, char *argv[])
{
system("PAUSE");
return EXIT_SUCCESS;
}



That sould work fine, but for there is a better soluction then this, please post it, I would really would appreciate it. Thanks!

Julio A. Cruz

Share this post


Link to post
Share on other sites
You can just ignore the warning or you can scroll to the last line in the file and just press enter which'll fix it. No need to mess around with the editor settings.

Share this post


Link to post
Share on other sites
For good style, go to the bottom of every file in your project and insert the following comment:

/* EOF */

Make sure you press ENTER after the comment. Then, don't write anything below the line and you'll never have a problem with it again.

Share this post


Link to post
Share on other sites
Sign in to follow this  

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

We are the game development community.

Whether you are an indie, hobbyist, AAA developer, or just trying to learn, GameDev.net is the place for you to learn, share, and connect with the games industry. Learn more About Us or sign up!

Sign me up!