C# Array of objects
<p>I've consumed a web service with two classes "address" and "request."  One of the properties of the request object is an array of address objects:</p>

<pre><code>request _req = new request();
_req.addresses = // expecting address[]
</code></pre>

<p>I know I'm doing this wrong (as I keep getting exception errors) so I'm hoping someone can help me out. How do I create an array of address objects and set the "_req.addresses" value equal to that object (address[])?  I get an "object reference not set to an instance..."  error on the second line, when trying to set the city value equal to the string _q.LocationA.City...  so these aren't working:</p>

<pre><code>    address[] _address = new address[1];
    _address[0].city = _q.LocationA.City;
    _address[0].state = _q.LocationA.State;
    _address[0].street = _q.LocationA.Address;
    _address[0].zipCode = _q.LocationA.Zip;

    request _req = new request();
    _req.addresses = _address;
</code></pre>

<p>And I've tried this:</p>

<pre><code>    address _address = new address();
    _address.city = _q.LocationA.City;
    _address.state = _q.LocationA.State;
    _address.street = _q.LocationA.Address;
    _address.zipCode = _q.LocationA.Zip;

    request _req = new request();
    _req.addresses[0] = _address;
</code></pre>
