c语言疑难解答。谢谢。报错error C2065: 'sprintf' : undeclared identifier

#include "stdafx.h"
#include <windows.h>
#include <windowsx.h>
#include "resource.h"
#include "MainDlg.h"

BOOL WINAPI Main_Proc(HWND hWnd, UINT uMsg, WPARAM wParam, LPARAM lParam)
{
switch(uMsg)
{
HANDLE_MSG(hWnd, WM_INITDIALOG, Main_OnInitDialog);
HANDLE_MSG(hWnd, WM_COMMAND, Main_OnCommand);
HANDLE_MSG(hWnd,WM_CLOSE, Main_OnClose);
}

return FALSE;
}

BOOL Main_OnInitDialog(HWND hwnd, HWND hwndFocus, LPARAM lParam)
{
return TRUE;
}

void Main_OnCommand(HWND hwnd, int id, HWND hwndCtl, UINT codeNotify)
{
switch(id)
{
case IDC_OK:
{
TCHAR name[123];
GetDlgItemText(hwnd, IDC_EDITNAME,name,sizeof(name));
TCHAR msg[123];
sprintf(msg, "%s你好", name);
MessageBox(hwnd, name, msg, MB_OK);
}
break;
default:
break;
}
}

void Main_OnClose(HWND hwnd)
{
EndDialog(hwnd, 0);
}

使用sprintf需要#include<stdio.h>追问

添加上去了也没用啊😭😭。

追答

没用是什么意思,出现什么问题,请详细说明。

温馨提示:答案为网友推荐,仅供参考