structures help please

so basically i was wondering how a nested structure would look like.

for example in our class we learned to do a struct

struct Student
{
string firstname;
string lastname;
double gpa;
string studentID;
};

but what would a nested structure look like? we are suppose to do a nested structure address that has city and state.


any help and all help appreciated
1
2
3
4
5
6
7
8
9
10
11
12
struct Student
{
  string firstname;
  string lastname;
  double gpa;
  string studentID;

  struct Address {
    string city;
    string state;
  };
};
ah ok thank you, so its basically a structure inside a structure. thank you very much =)
Topic archived. No new replies allowed.