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;
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!
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