copy C:\Users\MinCarve\documents\visual studio 2017\Projects\PROGRAM\Debug\PROGRAM.exe
C:\Users
Run Code Online (Sandbox Code Playgroud)
返回
该系统找不到指定的文件。当该目录中存在可执行文件 时!
当我尝试使用单词Join()一个数组并尝试在其中添加一个空格时,该空格似乎被遗漏了,不知道为什么吗?
一些背景信息,当我尝试反转给我的一串字时,
“嗨,我的名字是”应该变成“嗨,我的名字”
public static string ReverseWords(string text)
{
string[] words = text.Split(' ');
string s = "";
for (int i = words.Length - 1; i >= 0; i--)
{
s+= string.Join(" ", words [i]);
}
return s;
}
Run Code Online (Sandbox Code Playgroud)
预期的结果是:“世界!你好”,但结果是:“世界!你好”
如您所见,我错过了世界之间的空间!和你好。
有任何想法吗?
这是我的头文件包含的内容:
extern HMODULE Ws_32;
extern HMODULE User32;
extern HMODULE Kernel32;
extern HMODULE Advapi32;
typedef int (WINAPI *fnMessageBox)(
_In_opt_ HWND hWnd,
_In_opt_ LPCTSTR lpText,
_In_opt_ LPCTSTR lpCaption,
_In_ UINT uType
);
struct API
{
HMODULE User32;
fnMessageBox _MessageBox;
};
Run Code Online (Sandbox Code Playgroud)
这就是我的 CPP 文件包含的内容:
API Api;
VOID Tools::LoadApis(API Api)
{
if ((Api.User32 = GetModuleHandleW(L"USER32.DLL")) == ERROR)
{
Api.User32 = LoadLibraryW(L"USER32.DLL");
}
if (Api.User32)
{
Api._MessageBox = fnMessageBox(GetProcAddress(Api.User32, "MessageBox"));
}
}
int main()
{
Tools::LoadApis(Api); // not a part of the example
Api._MessageBox(0, 0, …Run Code Online (Sandbox Code Playgroud)