mirror of
https://github.com/zs-yg/kortapp-z.git
synced 2025-12-07 00:20:43 +08:00
添加内存锻炼器代码
This commit is contained in:
21
others/C/memory/src/error.c
Normal file
21
others/C/memory/src/error.c
Normal file
@@ -0,0 +1,21 @@
|
||||
#include "../include/memory_trainer.h"
|
||||
#include "../include/log.h"
|
||||
#include <windows.h>
|
||||
|
||||
// 错误代码定义
|
||||
const wchar_t* error_messages[] = {
|
||||
L"操作成功",
|
||||
L"内存分配失败",
|
||||
L"无效参数",
|
||||
L"系统错误"
|
||||
};
|
||||
|
||||
|
||||
|
||||
// 获取错误描述
|
||||
const wchar_t* get_error_message(ErrorCode code) {
|
||||
if (code < 0 || code >= sizeof(error_messages)/sizeof(error_messages[0])) {
|
||||
return L"未知错误";
|
||||
}
|
||||
return error_messages[code];
|
||||
}
|
||||
Reference in New Issue
Block a user