You are viewing a single comment's thread. Return to all comments →
class Student { private: int age; int standard; string first_name; string last_name;
public: // Setters void set_age(int a) { age = a; }
void set_standard(int s) { standard = s; } void set_first_name(string fn) { first_name = fn; } void set_last_name(string ln) { last_name = ln; } // Getters int get_age() { return age; } string get_last_name() { return last_name; } string get_first_name() { return first_name; } int get_standard() { return standard; } // Correct to_string() function string to_string() { stringstream ss; ss << age << "," << first_name << "," << last_name << "," << standard; return ss.str(); }
};
Seems like cookies are disabled on this browser, please enable them to open this website
Class
You are viewing a single comment's thread. Return to all comments →
class Student { private: int age; int standard; string first_name; string last_name;
public: // Setters void set_age(int a) { age = a; }
};