Guest_imported
New member
- Jan 1, 1970
- 0
I believe atoi() would be used, but how?
struct CarType
{
char MFG;
char Model;
char Color;
char TransType;
char Doors;
char Year;
}
cout<<"Vehicle must be a 1980 or newer vehicle to enter the program: "<<endl;
cout<<"Enter the vehicle year: ";
cin>>vehYear;
if ( vehYear >= 1980 || vehyear <= 2002)
strcpy(CarType.Year, vehYear)
// I am not sure how to convert the int data to char data.
// I need it to begin as int data so I can validate the year data before copying.
// Any help would be great!!
struct CarType
{
char MFG;
char Model;
char Color;
char TransType;
char Doors;
char Year;
}
cout<<"Vehicle must be a 1980 or newer vehicle to enter the program: "<<endl;
cout<<"Enter the vehicle year: ";
cin>>vehYear;
if ( vehYear >= 1980 || vehyear <= 2002)
strcpy(CarType.Year, vehYear)
// I am not sure how to convert the int data to char data.
// I need it to begin as int data so I can validate the year data before copying.
// Any help would be great!!