Jan 22, 2021 at 11:17am UTC
It shows error "expected primary-expression before ',' token" on line 10.
I ran out of ideas how to fix it.....
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20
#include <string>
using namespace std;
class Students{
string name;
string surname;
int age;
int No;
public :
Students():
Students(string, string, int , int );
void setName(string);
void SetSurname (string);
void setAge (int );
void setNo(int );
string getName();
string getSurname();
int getAge();
int getNo();
};
Last edited on Jan 22, 2021 at 11:17am UTC
Jan 22, 2021 at 11:24am UTC
Line 9: Replace the ':' with ';'
Jan 22, 2021 at 11:25am UTC
Watch your punctuation on line 9!
Students():
That colon should be ... a semicolon.
Jan 22, 2021 at 12:32pm UTC
Also when passing string to a function, you'd usually pass as const string& to avoid a pass-by-value copy (unless you're using move semantics later). age and No should be default initialised so that the default constructor doesn't have to.