using struct

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
// Demonstrating a student struct

#include "stdafx.h"
#include <iostream>

using namespace std;

struct student
{
	int creditHours;
	double gradePointAverage;
};

int main()
{
	Student oneSophomore;

	cout << "Please enter a student's credit hours ";
	cin >> oneSophomore.creditHours;
	cout << "Please enter the student's grade point average ";
	cin >> oneSophomore.gradePointAverage;

	cout << "The number of credit hours is " << oneSophomore.creditHours << endl;
	cout << "The grade point average is " << oneSophomore.gradePointaverage << endl;

	return 0;
}


I keep getting errors about sophomore and oneSophomore. I don't understand, I declared them like the book says.
Line 8 struct student
Line 16 Student oneSophomore;
oops. hee hee. how embarassing.
Topic archived. No new replies allowed.