- 顺序表定义请参考:https://www.cnblogs.com/kxwslmsps/p/16937235.html
- 打印顺序表
/** * @brief 功能:打印顺序表 \n * @param[in] plist:表结构指针 * @param[in] op:操作函数 */ void sList_output(const mySList* plist, myOpFunType* op) { if (plist == NULL || plist->pbase == NULL) { return; } printf("pbase=%p,capacity=%d,size=%d\n", plist->pbase, plist->capacity, plist->size); printf("["); for (int i = 0; i < plist->size; ++i) { op((void*)(&plist->pbase[i])); if (i + 1 == plist->size) { break; } printf(","); } printf("]\n===================================================\n"); }