// carstructure.cpp CIS-205 C/C++ 04/16/2002
// Demonstrates use of a Car structure
#include <iostream.h>
// prototypes
void createStructure(void);
struct Car
{
int doors;
int wheels;
char make[20];
char model[30];
};
int main(void)
{
createStructure();
return 0;
}
void createStructure(void)
{
Car myCar = {2, 4, "Ford", "Mustang"};
cout << "My car has " << myCar.doors << " doors." << endl;
cout << "My car has " << myCar.wheels << " wheels." << endl;
cout << "My car's make is " << myCar.make << "." << endl;
cout << "My car is a " << myCar.model << "." << endl;
}