#include<iostream>
using namespace std;
struct Student
{
char Name[30];
float GPA;
int Major;
};
//Function prototypes
Student* StudentData(Student* S);
void display(Student* S);
int main()
{
//Declare two objects of type 'Student'
Student* S1 = new Student;
Student* S2 = new Student;
//Pass this object into our function so it can be filled up with useful information
S1 = StudentData(S2);
//Display new and exciting information to the DOS console
display(S1);
display(S2);
return 0;
}
//Function Definitions
Student* StudentData(Student* S)
{
cout << "Enter name: ";
cin >> S->Name;
cout << "Enter GPA: ";
cin >> S->GPA;
cout << "please enter major" ;
cin >> S->Major;
return S;
}
void display(Student* S)
{
cout << S->Name << endl;
cout << S->GPA << endl;
cout << S->Major << endl;
}
Student* ChangeData(Student* S)
{
cout << "Enter name: ";
cin >> S->Name;
cout << "Enter GPA: ";
cin >> S->GPA;
cout << "please enter major" ;
cin >> S->Major;
return S;
}
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
EliteApple 0 Junior Poster in Training
Clinton Portis 211 Practically a Posting Shark
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.