C++ Struct on Class
<p>need some guide here</p>

<p>I got a code which is</p>

<pre><code>struct Point
{
   int x;
   int y;
};
</code></pre>

<p>then at my class i got a function</p>

<pre><code>class MyClass
{
   private:
      Point myPoint[4];
   public:
     void setPoint();
};

void MyClass::setPoint()
{
   int xData,yData;

   for (int i=0;i&lt;4;i++)
   {
      cout &lt;&lt; "Please enter x-ordinate:";
      cin &gt;&gt; xData;

      cout &lt;&lt; "Please enter y-ordinate:";
      cin &gt;&gt; yData;

      //at this part the code throw a segmentation core dump.
      myPoint[i].x = xData;
      myPoint[i].y = yData;
   }

}
</code></pre>

<p>On first run nothing happen, but on 2nd loop, segmentation core dump occur. whats wrong with my code?</p>

<p>Additional code on main.cpp</p>

<pre><code>#include "MyClass.h"

int main()
{
MyClass *mClass;

mclass-&gt;setPoint();
}
</code></pre>

<p>Thanks for helping.</p>
