Sign in to follow this  

Still problem with "no newline at end of file"

This topic is 4730 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

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

This topic is 4730 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.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this