why this C++ program runs so strange,the program died when added a empty function
<p>my code are as follows ,path1.updatePathInfo() is an function which  call an empty function,if delete this  it will works fine.I could't understand.</p>

<pre><code>////////////////////////////////////////////////////main.cpp

#include &lt;iostream&gt;
#include&lt;vector&gt;
#include "CPath.h"
using namespace std;
int main()
{
    for(int i = 0;i&lt;10;++i)
    {
        cout&lt;&lt;i;
        CPath path1;
        CPath path2;
        cross(path1,path2);
        path1.updatePathInfo();  //this is an function which call an empty function
                                 //if I delete this it works fine.I could't understand.
        path2.updatePathInfo();

    }
}
</code></pre>

<p>//////////////////////////////////////////////////////////////CPath.h</p>

<pre><code>#ifndef CPATH_H_
#define CPATH_H_
#include&lt;iostream&gt;
#include&lt;vector&gt;
#include&lt;fstream&gt;
#include&lt;map&gt;
#include&lt;cmath&gt;
#include&lt;cstdlib&gt;
class CPath
{
public:
    CPath();
    friend void cross(CPath &amp; path1,CPath &amp; path2);
    void updatePathInfo();
    std::vector&lt; int &gt; getPathByCode();
    void createRadomCode();
    std::vector&lt; int &gt; code;
    double pathLineLength;
};
#endif //CPATH_H_
</code></pre>

<p>//////////////////////////////////////////////////////////////////////CPath.cpp</p>

<pre><code>#include"CPath.h"
CPath::CPath()
{
    createRadomCode();
}

void cross(CPath &amp; path1,CPath &amp; path2)
{
    int max,min;
    max = rand()%8;
    min = rand()%8;
    if(min &gt; max)
    {
        max ^= min;min ^= max;max ^= min;
    }
    if(0.9*100&gt;rand()%100)
    {
        for(int i = min;i&lt;=max;++i)
        {
            path1.code[i]^=path2.code[i];
            path2.code[i]^=path1.code[i];
            path1.code[i]^=path2.code[i];
        }
    }
}

void CPath::updatePathInfo()
{
    getPathByCode();
}

std::vector&lt; int &gt; CPath::getPathByCode()
{
    //this function has nothing 
}

void CPath::createRadomCode()
{
    for(int i = 0 ; i&lt;8 ; ++i)
    {
        code.push_back(rand()%(i+1));
    }
}
</code></pre>
