vs2022中使用char类型,提示越界
#include<stdio.h>
int main(void)
{
char n;
printf("Please enter an ASCII code:");
scanf_s("%d", &n);
printf("%c", n);
return 0;
}
弹出来一个提示
Run-Time Check Failure #2 - Stack around the variable 'n' was corrupted.
请问该如何解决