how to use tostring method in c++
#include <string>
struct Student {
std::string name;
int age;
double finalGrade;
std::string toString() {
return "Name: " +
name +
"\n Age: " +
std::to_string(age) +
"\n Final Grade: " +
std::to_string(finalGrade);
}
};