Let's say I have an class called Person which takes two parameters:
firstName and lastName.
I can instantiate the object like so (c#)
Person myPerson = new Person ("George","Washington");
Now let's say I want to populate an array of objects based on the
Person class. How do I do this?
Person[] myPeople = new Person[5]; // I have declared an array of
objects.
myPeople[0].firstName = "George";
myPeople[0].lastName = "Washington";
OK, I populated the first occurance of the array of objects, but how
can I do it on one line like I did when it was not an array?
Thanks in advance for your help.