// ctqucl AT gmail.com
#include <iostream>
#include<string>
struct car
{
std::string Company;
int Year;
};
-
int main()
{
using namespace std;
int H_M;
cout<<"How many cars do you wish to catalog? ";
cin>>H_M;
car *user=new car [H_M];
for(int i=0;i<H_M;i++)
{
cout<<"Car #"<<i+1<<":"<<endl;
cout<<"Please enter the make : ";
cin.get(); //why need this?
getline(cin,user[i].Company);
cout<<"Please enter the year made : ";
cin>>user[i].Year;
}
-
for(int i=0;i<H_M;i++)
{
cout<<user[i].Year<<" "<<user[i].Company<<endl;
}
delete [] user;
}