Exception thrown at 0x003165F0 in tStack.exe: 0xC0000005: Access violation reading location 0x9BFF07EF.?
<p>Exception thrown at 0x003165F0 in tStack.exe: 0xC0000005: Access violation reading location 0x9BFF07EF.?</p>

<p>I can't seem to nail down the issue on this program. I keep getting read/write errors like this one in different places. Here is the .cpp and .h</p>

<p>.cpp:</p>

<pre><code>#include &lt;stdio.h&gt;  
#include &lt;stdlib.h&gt;
#include "stack.h"
#include &lt;string&gt;
#include &lt;iostream&gt;
//using namespace std;

tStack::tStack()
{
}

tStack::~tStack()
{
}

tStack::tStack(const tStack &amp;)
{
}

void tStack::Pop()
{
    snode *tmp_ptr = NULL;

    if (front)
    {

        tmp_ptr-&gt;next = front;
        front = tmp_ptr;
        free(tmp_ptr);
    }
    else
        std::cout &lt;&lt; "\nStack is Empty";
}

void tStack::Push(std::string op)
{
    snode *tmp_ptr = front;

    tmp_ptr-&gt;data = op;

    if (front)
    {
    tmp_ptr-&gt;next = front;
    front = tmp_ptr;
    }
    else
    {
    front = tmp_ptr;
    front-&gt;next = NULL;
    }
}

void tStack::Print()
{
    snode *cur_ptr = front;

    if (cur_ptr)
    {
        std::cout &lt;&lt; "\nElements in Stack:\n";
        while (cur_ptr)
        {
            std::cout &lt;&lt; cur_ptr-&gt;data;
            cur_ptr = cur_ptr-&gt;next;
        }
        std::cout &lt;&lt; "\n";
    }
    else
        std::cout &lt;&lt; "\nStack is Empty";
}

void tStack::cStack()
{
    free(front);
}

void tStack::convert(std::string postfix, tStack a)
{
    int count = 0;
    bool lastOper;
    std::string pusher, val1, val2;

    for (int i = 0; i &lt; postfix.size(); i++)
    {
        if (isalpha(postfix[i]))
        {
            pusher = postfix[i];
            a.Push(pusher);
            count++;

        }
        else
        {

            if (count &lt; 2)
            {
                std::cout &lt;&lt; "There are not enough values to perform an operation.";
            }

            else
            {
                pusher = postfix[i];
                val1 = front-&gt;data;
                a.Pop();
                val2 = front-&gt;data;
                a.Pop();
                a.Push(")");
                a.Push(val1);
                a.Push(pusher);
                a.Push(val2);
                a.Push("(");
            }
            lastOper = true;
        }
    }
}
</code></pre>

<p>.h:</p>

<pre><code> #pragma once
#include &lt;stdio.h&gt;  
#include &lt;stdlib.h&gt;
#include "stack.h"
#include &lt;string.h&gt;
#include &lt;iostream&gt;
//using namespace std;
class snode
{
public:
    std::string data;
    snode *next;
};
class tStack
{
public:
    tStack();
    ~tStack();
    tStack(const tStack &amp;);
    void Pop();
    void Push(std::string);
    void Print();
    void cStack();
    void convert(std::string, tStack);
private:

    snode *front;


};
</code></pre>

<p>I found some posts suggesting not using using namespace std but that doesn't seem to help. Do I just have a total misunderstanding of how linked lists work?</p>