CLogger::~CLogger() { Flush(); m_CacheSize = 0; DeleteArr(&m_CacheBuffer); DeleteArr(&m_WriteBuffer); }
/************************************************* Function: main Description: 主函数 Calls: scanf printf Called By: 编译器 Input: 无 Output: 无 Return: 0 *************************************************/ int main(void) { int len; int res; int pos = 0; int val = 1030; struArray StruArray; printf("input the array length\n"); scanf("%d", &len); InitArr(&StruArray, len); //下列为测试程序 AppendArr(&StruArray, 512); ShowArr(&StruArray); AppendArr(&StruArray, 999); ShowArr(&StruArray); AppendArr(&StruArray, 1111); ShowArr(&StruArray); AppendArr(&StruArray, val); ShowArr(&StruArray); AppendArr(&StruArray, 666); ShowArr(&StruArray); InsertArr(&StruArray, 10, 40); ShowArr(&StruArray); DeleteArr(&StruArray, 9); ShowArr(&StruArray); if (FindVal(&StruArray, val, &pos)) { printf("%d:%d\n", val, pos); } if (Get(&StruArray, 8, &res)) { printf("res:%d\n", res); } SortArr(&StruArray); ShowArr(&StruArray); if (FindVal(&StruArray, val, &pos)) { printf("%d:%d\n", val, pos); } InverseArr(&StruArray); ShowArr(&StruArray); if (FindVal(&StruArray, val, &pos)) { printf("%d:%d\n", val, pos); } DeleteAll(&StruArray); return 0; }