gpt4 book ai didi

c++ - 字符数组的初始化字符串太长

转载 作者:行者123 更新时间:2023-11-28 01:10:47 36 4
gpt4 key购买 nike

我正在为游戏制作补丁程序,但我从 Mingw 收到错误消息“字符数组的初始化字符串太长”。我正在尝试制作一个多维字符数组以包含要修补的函数。
我检查了有关此问题的其他问题,发现提问者忘记在每个字符串文字的末尾添加逗号,但我已经这样做了。

谁能帮帮我?

触发错误的来源:

char patches2[][64] = {
"CreateMutexW",
"CreateRemoteThread",
"CreateRemoteThreadEx",
"?strcmp@unicode_string_trait@esl@@SAJPB_W0@Z",
"??0?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@QAE@XZ",
"??0?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@QAE@PB_W@Z",
"??4?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@QAEAAV01@PB_W@Z",
"?GetContent@?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@QBEPB_WXZ",
"?SetLookUpOrder@CFileSystem@esl@@QAEXW4EFileLookUpOrder@esl_constant@2@@Z",
"??1package_file_item@esl@@QAE@XZ",
"??1CFormatter@esl@@QAE@XZ",
"??6CFormatter@esl@@QAEAAV01@K@Z",
"??6CFormatter@esl@@QAEAAV01@G@Z",
"??6CFormatter@esl@@QAEAAV01@M@Z",
"??6CFormatter@esl@@QAEAAV01@PB_W@Z",
"??BCFormatter@esl@@QBE?AV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@1@XZ",
"?__time@etc@esl@@YAKXZ",
"?ReadFSAA@CGameOptionMgr@pleione@@QAE?AW4EFSAA@pleione_constant@2@XZ",
"?ReadFSAAQuality@CGameOptionMgr@pleione@@QAEKXZ",
"?CleanUp@CPleione@pleione@@QAE_NXZ",
"?SetSkyTime@CAtmosphere@pleione@@QAEXM@Z",
"?SetCamera@CCameraControl@pleione@@QAEXPAVCScene@2@PAVITerrain@2@KFF@Z",
"?GetObjectId@CObject@mint@@QBE_KXZ",
"?ReadU8@CMessage@mint@@QAEEXZ",
"?GetLuck@IParameter@core@@QAEMXZ",
"?GetGateLocalName@CGateMgr@core@@QBE?BV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@AB v34@@Z",
"?GetLife@IParameterBase2@core@@QAEMXZ",
"?GetLifeMax@IParameterBase2@core@@QAEMXZ",
"?IsEiry@SItemEgoInfo@@QBE_NXZ",
"?SetFog@CDungeonRegion@core@@QAEX_N@Z",
"?GetTargetCombatPower@ICharacter@core@@QAE?AW4ECombatPower@@PBname2@@Z",
"?GetCombatPower@IParameterBase2@core@@QBEMXZ",
"?GetInterfaceDurability@IItem@core@@QBEKXZ",
"?GetInterfaceDurabilityMax@IItem@core@@QBEKXZ",
"?GetColor@IItem@core@@QBEKK@Z",
"?IsElf@ICharacter@core@@QBE_NXZ",
"?IsGiant@ICharacter@core@@QBE_NXZ",
"?IsPet@ICharacter@core@@QBE_NXZ",
"?IsNPC@ICharacter@core@@QBE_NXZ",
"?IsNamedNPC@ICharacter@core@@QBE_NXZ",
"?IsGoodNPC@ICharacter@core@@QBE_NXZ",
"?Compile@CDefaultCompiler@pleione@@UAEPAVCCompiledText@2@ABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@ABUtext_option@2@@Z",
"?Compile@CDefaultTagCompiler@pleione@@UAEPAVCCompiledText@2@ABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@ABUtext_option@2@@Z",
"?Compile@CHTMLCompiler@pleione@@UAEPAVCCompiledText@2@ABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@ABUtext_option@2@@Z",
"?_RenderGlowOverlay@CRendererContext@pleione@@AAEXXZ",
"?GetExploLevel@IParameterBase2@core@@QBEGXZ",
"?GetExploExpPercent@IParameter@core@@QBEMXZ",
"?ParseCommand@CUserConsoleMgr@core@@QBE_NABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@AAVCUserConsole@2@@Z",
"?Instance@CLocalizer@core@@SAAAname2@XZ",
"?GetLocalText@CLocalizer@core@@QBE?AVCFormatter@esl@@ABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@4@@Z",
"?stdapi_ShowChattingMessage@core@@YAX_KABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@1KKE@Z",
"?stdapi_ShowCaption@core@@YAX_KABV?$CStringT@_WVunicode_string_trait@esl@@Vunicode_string_implement@2@@esl@@W4EMessageCaptionType@@KKK0@Z",
"?stdapi_GetGlobalTime@core@@YA_KXZ",
"?stdapi_GlobalTimeToGameTime@core@@YAX_KAAK11@Z",
"?IsUsingNaosSupport@IServiceMgr@core@@QBE_NXZ",
"?CheckFastStringID@IProp@core@@QBE_NPB_W@Z",
"?IsUsableContents@IServiceMgr@core@@QBE_NW4EServiceContents@2@@Z",
"?IsTransformed@ITransformMgr@core@@QBE_NXZ",
"?GetFullSuitID@ICharacter@core@@QAEKXZ",
"?IsBroken@IItem@core@@QBE_NXZ",
"?CheckFastStringID@IItem@core@@QBE_NPB_W@Z",
"?IsExpired@IItem@core@@QAE_N_K@Z",
"?IsArenaField@IRegion@core@@QBE?B_NXZ",
"?CanAttackTarget@IPVPMgr@core@@QBE_NPBVICharacter@2@@Z"
};

最佳答案

char patches2[][64]

这是一个数组的数组。第一维是根据初始值设定项中的元素数量自动确定的。第二个维度指定为 64 个 char

用于初始化 patches2 的一些字符串文字的长度超过 64 个字符。您需要将大小增加到某个足够大的值以容纳初始化程序中的最大 C 字符串。

关于c++ - 字符数组的初始化字符串太长,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3380572/

36 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com