Help needed to debug this c++ program
<p>Hya,</p>

<p>i need help to debug this program .</p>

<pre><code>// VirtualFN.cpp : Defines the entry point for the console application.
//

#include "stdafx.h"
#include &lt;iostream&gt;
#include &lt;conio.h&gt;
#include &lt;string&gt;
#include &lt;iomanip&gt;

using namespace std;
enum isautostart { no,yes };

class vehicle {
protected:
    static int noofvehicles;
    string vehiclename;
    long long int price;
    isautostart autostart;
public:
    vehicle():price(0),autostart(no),vehiclename("N/A")
    {
        noofvehicles++;
    }
    vehicle (vehicle&amp; tempveh){
        vehiclename = tempveh.vehiclename;
        autostart = tempveh.autostart;
        price = tempveh.price;
    }
    virtual void getdataofvehicle(){
        string tempcarname;
        char check[15];
        cout&lt;&lt; "\nPlease enter the name of vehicle :"; 
        getline(cin,tempcarname);
        vehiclename = tempcarname;
        /*******************************************************/

        while(true){
        cout&lt;&lt; "Please enter the price of the car :"; cin&gt;&gt;setw(14)&gt;&gt;check;
        if(atoi(check)){
            price = atoi(check);
            break;}
        else{
            cout&lt;&lt; "you didn't enter the integer number , Try again"&lt;&lt;endl;
        }
        }
        /*******************************************************/
        char bools;
        cout &lt;&lt;"Vehicle has autostart funtion ? : (y/n)"; cin &gt;&gt; bools;
        if(bools == 'y'){
            autostart = yes;
        }
        else { autostart = no; }
    }
    virtual void displaycardata() {
        cout&lt;&lt; "\nName of vehicle is :" &lt;&lt; vehiclename;
        cout&lt;&lt; "\nPrice of the vehicle is : $" &lt;&lt;price;
        if(autostart){
            cout&lt;&lt; "\nThis vehicle is autostart.";}
        else{
            cout&lt;&lt; "\nThis vehicle is not autostart.";}

    }
    static void displaynoofcars(){
        cout&lt;&lt;"\nNo of cars in warehouse are :" &lt;&lt; noofvehicles;
    }
};

int vehicle::noofvehicles = 0;

class mercedez : public vehicle {
    string color;
public:
    mercedez(): vehicle() {
        color = "N/A";}
    void getdataofvehicle() {
        vehicle::getdataofvehicle();
        cout&lt;&lt;"\nPlease enter the color of the car :"; 
        cin &gt;&gt; color;
    }
    void displaycardata(){
        vehicle::displaycardata();
        cout&lt;&lt;"\nThe color of the car is:" &lt;&lt; color;
    }
};



int main()
{
    vehicle *v1;
    vehicle *v2;
    mercedez a;

    v1 = new vehicle;
    vehicle::displaynoofcars();
    v2 = new mercidez;
    vehicle::displaynoofcars();
    v1-&gt;getdataofvehicle();
    v1-&gt;displaycardata();
    v2-&gt;getdataofvehicle();
    v2-&gt;displaycardata();

    getch();

    return 0;

}
</code></pre>

<p>now when inherited class mercedez try to execute getdataofvehicle of vehicle by v2->getdataofvehicle();</p>

<p>getdataofvehicle function part of base class doesn't takes the input, just diaplays the "Please enter the price of the car :" and jumps directly to :
cout&lt;&lt; "Please enter the price of the car :"; cin>>setw(14)>>check;</p>

<p>Can anyone please debug this and tell me why is this happening</p>

<p>Any help is very appreciated</p>
