0

I'm trying to get what I put in the value for the database to output, however whenever I use a cout statement with the a.name I get an error on line 21 which is the line with the cout statement. I've done it the way it is in the examples of my textbook so I don't understand what is going wrong.

#include <iomanip>
#include <iostream>
using namespace std; 

 struct Student
  {
	string name;
	string address;
	string city;
	string state;
	string zip;
	string gender;
	string id;
	float gpa;
  } a, b, c;

int main()
{
  a.name = "John";

  cout << a.name;

  cout << "Press ENTER to continue..." << endl;
  cin.get();

  return 0;
}
2
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by gizmo7008
This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.