#include <iostream>
#include <string>
#include <stdlib.h>

using namespace std;

struct Student {
	string name;
	string matrix;
	int age;
};

void getStudent(Student);
void getStudentPBF(Student &);
void displayStudent(const Student &);

int main(void) 
{	
	Student student = {"ali", "mat1101", 23};
	
	//getStudent(student);
	getStudentPBF(student);
	
	displayStudent(student);
	
    return 0;
} 

void getStudent(Student student) {
	cout << "Enter student name: ";
	getline(cin, student.name);
	
	cout << "Enter student matrix: ";
	getline(cin, student.matrix);
	
	cout << "Enter student age: ";
	cin >> student.age;	
}

void getStudentPBF(Student &student) {
	cout << "Enter student name: ";
	getline(cin, student.name);
	
	cout << "Enter student matrix: ";
	getline(cin, student.matrix);
	
	cout << "Enter student age: ";
	cin >> student.age;	
}

void displayStudent(const Student &student) {
	cout << "Student name: " << student.name << endl;
	cout << "Student matrix: " << student.matrix << endl;
	cout << "Student age: " << student.age << endl;
}
