Check if array is null or empty?
<p>I have some problem with this line of code:</p>

<pre><code>if(String.IsNullOrEmpty(m_nameList[index]))
</code></pre>

<p>What have I done wrong?</p>

<p>EDIT: The m_nameList is underlined with red color in VisualStudio, and it says "the name 'm_nameList' does not exist in the current context"??</p>

<p>EDIT 2: I added some more code</p>

<pre><code>    class SeatManager
{
    // Fields
    private readonly int m_totNumOfSeats;

    // Constructor
    public SeatManager(int maxNumOfSeats)
    {
        m_totNumOfSeats = maxNumOfSeats;

        // Create arrays for name and price
        string[] m_nameList = new string[m_totNumOfSeats];
        double[] m_priceList = new double[m_totNumOfSeats];
    }

    public int GetNumReserved()
    {
        int totalAmountReserved = 0;

        for (int index = 0; index &lt;= m_totNumOfSeats; index++)
        {
            if (String.IsNullOrEmpty(m_nameList[index]))
            {
                totalAmountReserved++;
            }
        }
        return totalAmountReserved;
    }
  }
}
</code></pre>
