#include <string>
using namespace std;
struct Student
{
string name;
int id;
float gpa;
}; // Student
Student getGeorge()
{
Student george;
george.name = "George";
george.id = 123456;
george.gpa = 3.4;
return george;
} // getGeorge
void printRecord(Student& x)
{
cout << "Name=" << x.name;
cout << ", ID=" << x.id;
cout << ", GPA=" << x.gpa;
} // printRecord
int main()
{
Student s = getGeorge();
printRecord(s);
return 0;
} // main
No comments:
Post a Comment