CPP04 1.0
読み取り中…
検索中…
一致する文字列を見つけられません
main.cpp ファイル

Main entry point for C++ Module 04 Exercise 02. [詳解]

#include "Animal.hpp"
#include "Brain.hpp"
#include "Cat.hpp"
#include "Dog.hpp"
#include "ScopedPointer.hpp"
#include "WrongAnimal.hpp"
#include "WrongCat.hpp"
#include <cstdlib>
#include <iostream>
main.cpp の依存先関係図:

[ソースコード]

関数

int main ()
 Main function to demonstrate abstract classes and polymorphism.
 

詳解

Main entry point for C++ Module 04 Exercise 02.

This file serves as a test driver to demonstrate the behavior of the Animal, Dog, Cat, WrongAnimal, WrongCat, and Brain classes after Animal has been made an abstract class. It verifies that Animal objects cannot be directly instantiated and that polymorphic behavior continues for derived concrete classes. It includes tests for deep copy and memory management.

main.cpp に定義があります。

関数詳解

◆ main()

int main ( )

Main function to demonstrate abstract classes and polymorphism.

Calls various static helper functions to showcase different aspects of the Animal hierarchy after Animal has been made abstract. An attempt to instantiate Animal directly will result in a compile-time error.

戻り値
0 on successful execution.

main.cpp47 行目に定義があります。