|
|
| WateringPlan.C |
#include <iostream.h>
#include <string.h>
#include "Plant.h"
#include "PlantList.h"
using namespace std;
int main() {
PlantList plants;
string name; int frequency;
while (cin >> name && cin >> frequency) {
plants.add(Plant(name, frequency));
}
plants.print_plan();
}
|
![]() | While cin >> name normally returns cin to permit
a concatenation of operations, it is in the given context
| ||||
![]() | This works in a way that the condition evaluates to
true if both read operations succeed and to false
otherwise.
| ||||
![]() | Plant(name, frequency) creates an anonymous object
of type Plant that is destroyed after the execution of
the statement using it finishes.
|
|
| Copyright © 2001, 2002 Andreas Borchert, converted to HTML on February 21, 2002 |