1. 背景说明


循环链表(circular linked list),是另一种形式的链式存储结构。它的特点是表中最后一个结点的指针域指向头结点,
整个链表形成一个环。由此,从表中任一结点出发均可找到表中其他结点 。
2. 示例代码
1) errorRecord.h
- // 记录错误宏定义头文件
-
- #ifndef ERROR_RECORD_H
- #define ERROR_RECORD_H
-
- #include
- #include
- #include
-
- // Extracts the file name from the file path
- #define FILE_NAME(X) strrchr(X, '\\') ? strrchr(X, '\\') + 1 : X
-
- // Define DEBUG macro for enabling debug mode
- #define DEBUG
-
- // Print error message
- #ifdef DEBUG
- #define ERR_RECORD(ERR_CODE, ...) do { \
- printf(ANSI_CO