Exemple #1
0
int main() {
    std::vector<Dog> v = { Dog(3), Dog(1), Dog(5), Dog(2), Dog(4) };
    std::cout << "vector<Dog>:\n";
    for(auto &d: v) d.print();
    sort(std::begin(v), std::end(v));

    std::cout << "\nsorted vector<Dog>:\n";
    for(auto &d: v) d.print();
}
Exemple #2
0
void main () {

//calling and instantiation of the classes

		Dog spots = Dog();
	
		cout<<spots.weight << endl;

		spots.run();
		spots.bark();

	cout << spots.weight <<endl;
	system("PAUSE");
}