Skip to content
Snippets Groups Projects
Commit b90e1062 authored by Peter Faber's avatar Peter Faber
Browse files

Array-Initialisierung bei manchen Compilern nicht mehr akzeptiert

parent 873c28da
Branches main
No related tags found
No related merge requests found
......@@ -17,10 +17,10 @@ public:
Car()
{
cout << "A new car has been created." << endl;
cout << "Brand: ";
cin >> brand;
cout << "Passenger: ";
cin >> passenger;
cout << "Brand: ";
cin >> brand;
cout << "Passenger: ";
cin >> passenger;
}
void boarding(int persons)
......@@ -30,23 +30,23 @@ public:
void display()
{
cout << "Brand: " << brand << endl;
cout << "Passenger: " << passenger << endl;
cout << "Brand: " << brand << endl;
cout << "Passenger: " << passenger << endl;
}
};
class Truck : public Vehicle
{
private:
float tonnes;
float tonnes;
public:
Truck()
Truck()
{
cout << "A new Truck has been created." << endl;
cout << "Brand: ";
cin >> brand;
cout << "Tonnes: ";
cin >> tonnes;
cout << "Brand: ";
cin >> brand;
cout << "Tonnes: ";
cin >> tonnes;
}
void loading(float weight)
......@@ -56,15 +56,15 @@ public:
void display()
{
cout << "Brand: " << brand << endl;
cout << "Tonnes: " << tonnes << endl;
cout << "Brand: " << brand << endl;
cout << "Tonnes: " << tonnes << endl;
}
};
int main()
{
Car cars[3] = Car();
Truck trucks[2] = Truck();
Car cars[3];
Truck trucks[2];
int persons;
float weight;
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment