C++60 design pattern ][ SingleTon design pattern ][ SingleTon 1소스 #include #include using namespace std; class SingleTon { public: static SingleTon* GetInstance() { if(NULL == pInstance) { pInstance = new SingleTon; } return pInstance; } static void ReleaseInstance() { delete pInstance; pInstance = NULL; } void TestPrint() { printf("Test SingleTon\n"); } private: SingleTon(){}; ~SingleTon(){}; static SingleTon* pInstance; }; Sin.. 2016. 7. 14. Round Robin Scheduling Algorithm Round Robin Scheduling Algorithm 1. 소스1 #include #include #include #include using namespace std; struct process { int no; int at,et,wt,tt; int tet; int t; }; /* reads from keypress, doesn't echo */ int getch(void) { struct termios oldattr, newattr; int ch; tcgetattr( STDIN_FILENO, &oldattr ); newattr = oldattr; newattr.c_lflag &= ~( ICANON | ECHO ); tcsetattr( STDIN_FILENO, TCSANOW, &newattr ); .. 2016. 7. 14. hash string hash string1.소스 #include #include #include #include using namespace std; unsigned long getHashCode(const char* pString) { unsigned long hash = 5381; int len = strlen(pString); for(int i = 0; i ::iterator it = container.find( getHashCode("test") ); cout 2016. 7. 12. vector 값 복사 vector 값 복사 1.소스 2016. 7. 12. 이전 1 ··· 9 10 11 12 13 14 15 다음