Making an array for a class
I'm just learning C++, and I've been given a project to make a class Person with 6 different parts to it. Then, I have to make an array of 5 people initializing each part for each person.
I wrote the class, but I don't know how to initialize the array of people.
Do I first have to declare:
Person P1, P2, P3, P4, P5, P6; (with parameters)
and then how do I declare the array?
Do I have to write Person first again or do I make it a certain data type. And does the name of the array have to be Person or different from person?
Thanks for any help
Does anyone know what's wrong with this?
I'm having more problems. I made a class Person and each Person takes 6 parameters. Now, I'm supposed to make an array of 5 people. Can anyone tell me what is wrong with the code below? I really have not idea how to define this array, so I just tried to come up with something out of a book.
Thanks for any help
I attached my main file
I'm getting errors like:
left of '.Person' must have class/struct/union type
syntax error : identifier 'Person'
subscript requires array or pointer type