int main(int argc, char** argv){ int i = 0; void * ptr = &hello; printf(">>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>Linked exe started <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<< \n" ); printf(" hello = %x\n", ptr); // for (i=0; i<10; i++){ char buf[100]; sprintf(buf, "caller %d\n", i); printf("Calling hello(buf):\t"); hello(buf); hello1(); hello2(); hello3(); hello4(); hello5(); testFunc(); // } printf("PID == %d\n", getpid()); return 0; }
int main(){ printf("hello World!\n"); hello1();//打印3行hello world; // hello1(); //int a=2; // hello2(a); return 0; }
int main() { boost::shared_ptr<HelloInterface> h1 = boost::make_shared<HelloCoutImpl1>(); boost::shared_ptr<HelloInterface> h2 = boost::make_shared<HelloCoutImpl2>();; HelloWorld hello1(h1); HelloWorld hello2(h2); hello1.outputMessage(); hello2.outputMessage(); HelloWorld hello3(boost::make_shared<HelloCoutImpl1>()); return 0; }
int main() { hello1(); hello2(); return 0; }