#include <iostream>
#include <cctype>
#include <string>
using namespace std;
int main()
{
int year;
char model[50];
cout << "What year is your car? ";
cin >> year;
cin.ignore();
cout << "What is the model? ";
cin.getline(model, 50);
cout << "So you drive a " << year << " " << model << "." << endl;
strcpy(model, "Tesla Model S");
cout << "So you drive a " << year << " " << model << endl;
return 0;
}
#include <cctype>
#include <string>
using namespace std;
int main()
{
int year;
char model[50];
cout << "What year is your car? ";
cin >> year;
cin.ignore();
cout << "What is the model? ";
cin.getline(model, 50);
cout << "So you drive a " << year << " " << model << "." << endl;
strcpy(model, "Tesla Model S");
cout << "So you drive a " << year << " " << model << endl;
return 0;
}