DesignPattern/01.SimpleFactory/2.Code/main.cpp

20 lines
352 B
C++
Raw Normal View History

2019-10-17 13:55:01 +00:00
#include <iostream>
#include "SimpleFactory.h"
int main()
{
printf("<EFBFBD>򵥹<EFBFBD><EFBFBD><EFBFBD>ģʽ\n");
//<2F><><EFBFBD><EFBFBD><E5B9A4><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD><EFBFBD>
Factory *fac = new Factory();
AbstractSportProduct *product = NULL;
product = fac->getSportProduct("Basketball");
product = fac->getSportProduct("Football");
product = fac->getSportProduct("Volleyball");
system("pause");
return 0;
}