return a struct array and use at main class
<p>A bit of information</p>

<pre><code>Parent Class: Vehicle
Child Class: Car &amp; Motorcycle
</code></pre>

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

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

<p>and i got a <code>setPoint</code> function at <code>Car</code> &amp; <code>Motorcycle</code> which do the following</p>

<p>since <code>Car</code> got 4 wheels and <code>Motorcycle</code> got 2 wheels.</p>

<p><code>Car</code> will have this function</p>

<pre><code>class Car : public Vehicle
{
private:
    Point wheelPoint[4]; // if motorcycle then its wheelPoint[2]
public:
    Point getPoint();
    void setPoint();
}

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

    for (int i=0;i&lt;4;i++)
    {
         cout &lt;&lt; "Please enter X  :" ;
         cin &gt;&gt; xData;
         cout &lt;&lt; "Please enter Y  :" ;
         cin &gt;&gt; yData;
    }//end for loop
}//end setPoint
</code></pre>

<p>so i got a <code>getPoint</code> function also..</p>

<pre><code>Point Car::getPoint()
{
     return wheelPoint;
}
</code></pre>

<p>The issue is at my main.cpp , i did the following</p>

<pre><code>int main()
{
     VehicleTwoD *vehicletwod[100];

     //assuming just car but there motorcycle too
     Car *mCar = new Car();
     Point myPoint;

     vechicletwod[0] = mCar;
     //here i did the setpoint, set other variable

     //then when i try retrieve
     myPoint = Car-&gt;getPoint();
     //no error till here.

     cout &lt;&lt; sizeof(myPoint);
}
</code></pre>

<p>no matter its motorcycle or car, the result always stay at 4, it wont be 2 for motorcycle and 4 for car. i not sure whats wrong</p>

<p>Assuming i did the setpoint for motorcycle too. both return same result, is my contain Point myPoint in main class unsuitable to contain a wheelPoint[array]</p>
