data structure lab 1

profileahmeddxn7
CSC240_RangeBasedForLoop.cpp

//============================================================================ // Name : CSC240_RangeBasedForLoop.cpp // Author : // Version : // Copyright : Your copyright notice // Description : Hello World in C++, Ansi-style //============================================================================ #include <iostream> #include "Larva.h" using namespace std; int main() { Larva myLarva[3]; Larva larva1("blue", slim); Larva larva2("red", round); Larva larva3("yellow", stinky); myLarva[0] = larva1; myLarva[1] = larva2; myLarva[2] = larva3; for(Larva item : myLarva){ cout << item.getColor() << " " << item.getType() << endl; } return 0; }