int main() { Resume *linResume = new Resume("Lincoln"); linResume->setAge("23"); linResume->setSex("M"); puts(linResume->toString()); Resume *linResume2 = linResume->clone(); linResume2->setAge("22"); puts(linResume2->toString()); return 0; }
void PrototypeMain::main(std::string args[]) { Resume* linResume = new Resume("Lincoln"); linResume->setAge("23"); linResume->setSex("M"); //JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString': puts(linResume->toString()); Resume* linResume2 = linResume->clone(); linResume2->setAge("22"); //JAVA TO C++ CONVERTER TODO TASK: There is no native C++ equivalent to 'toString': puts(linResume2->toString()); }
void testPrototype() { std::cout << "-------------------test Prototype[start]-----------------------" << std::endl; Resume *liqiResume = new Resume("Liqi"); liqiResume->setSex("Male"); liqiResume->setWorkExperience("2011 - 10 -02", "Central South University"); liqiResume->display(); Resume* wr = (Resume*)liqiResume->clone(); wr->display(); wr->setName("HR"); wr->setSex("Female"); wr->display(); wr->setWorkExperience("2007 - 10 - 01", "Beijin"); wr->display(); delete liqiResume; std::cout << "-------------------test Prototype[end]-------------------------" << std::endl; }