那么在带有字符串的java中你可以这样做:
int stuff;
string otherstuff;
otherstuff = "I like this much stuff: " + stuff;
Run Code Online (Sandbox Code Playgroud)
但在C++中我不知道如何.
我一直在试验WINAPI尝试学习它,但我创建的窗口立即关闭.正如您所看到的那样,当按下W键或按下左键时,它将关闭程序,但在没有按下任何按钮的情况下运行它时它仍会关闭.
#include <windows.h>
#include <windowsx.h>
// the WindowProc function prototype
LRESULT CALLBACK WindowProc(HWND hWnd,
UINT message,
WPARAM wParam,
LPARAM lParam);
// the entry point for any Windows program
int WINAPI WinMain(HINSTANCE hInstance,
HINSTANCE hPrevInstance,
LPSTR lpCmdLine,
int nCmdShow)
{
// the handle for the window, filled by a function
HWND hWnd;
// this struct holds information for the window class
WNDCLASSEX wc;
// clear out the window class for use
ZeroMemory(&wc, sizeof(WNDCLASSEX));
// fill in the struct with the needed …Run Code Online (Sandbox Code Playgroud) Visual Studios忽略了我想要播放的文件.使用此代码,它返回false,因为它不加载文件.
result = LoadWaveFile("../Engine/data/sound01.wav", &m_secondaryBuffer1);
if (!result)
{
return false;
}
Run Code Online (Sandbox Code Playgroud)