what does this error means?

i have an er here
: warning: no newline at end of file
what should i do whit it? where did i go wrong?
here is the hole program:
#include <iostream>
#include <conio.h>
#include <cstdlib>
#include <string.h>
#include <stdint.h>
#include <stddef.h>
using namespace std;
{
struct student {
char name[30];
char family[30];
float avg;
};
void main ()
{

struct student s;
struct student max;
int i;
cout << "enter name - family name - average ";
cin >> s.name >> s.family >> s.avg;
max = s;
for (i=1 ;i<10 ; i++ )
{
cin >> s.name >> s.family >> s.avg;
if (max.avg < s.avg)
max = s;
}
cout << "name -->"<< max.name<<endl;
cout << "family name -->" << max.family << endl;
cout << "average -->" << max.avg << endl;

}



return 0;
}


Well it's not an error, your code will still run, it's just a warning, and it's easily solved. Go to the end of your file, hit enter to add a new line. Ta daa!

the "{" after using namespace std; shouldn't be there...

void main() should be int main()

and you have an extra "}" (probably to cover the other one) right before return 0;

It would be more helpful if you post the errors next time as well

-- did you just get that warning? that's odd, I got errors...
Last edited on
ha ha ! thanks . that was stupid.
there is two error when i run this can you help me with them?
1 ) error: expected `,' or `;' before '{' token
2) expected unqualified-id before '{' token
thank you so much! its working now :)
Topic archived. No new replies allowed.