Access violation reading location 0xC0000005 C++
<p>My add function clearly has a problem as it is dereferencing first and first is pointing to nothing because of that. I just don't know how to fix it so that it isn't a null pointer. </p>

<pre><code>    struct Node
    {
        int data;
        Node *next;
    };

    class LinkedList
    {
        Node *first;
        Node *last;
        int count;
        public:

        LinkedList()
        {
            first = NULL;
            last = NULL;
            count = 0;
        }


        void Add(int item)
        {
            if (first == NULL)
            {
                first-&gt;data = item;
                last-&gt;data = item;
                last-&gt;next = NULL;
                first-&gt;next = last;
                count = 1;
            }
            else
            {
                Node *newNode = new Node;
                newNode-&gt;data = last-&gt;data;
                newNode-&gt;next = last;
                last-&gt;data = item;
                last-&gt;next = NULL;
                count ++;
            }
        }
</code></pre>
