No newline at end of file

I just wrote a simple program that reads from a file and displays one of the numbers in it here:

#include <iostream>
#include <fstream>
#include <iomanip>

using namespace std;

int main()
{

ifstream fp;
fp.open("poly.txt");
int number[20]

while (fp.eof()==false)
{
for (int i = 0; i < 20; i++)
{
fp >> number[i];
}
}

cout << number[2] << endl;

}

And I keep getting an error that states 'ptest.cpp:27:3: warning: no newline at end of file' when trying to compile in emacs. I use pspad to write the program, and there is an extra, blank line (line 27) at the end of it. So i have no idea what the problem is, anyone have an idea?
Some text editors append a newline to files which end with something that is not a newline
Others remove trailing blank characters / lines.
Check the editor settings to get a consistent trailing newline
Topic archived. No new replies allowed.