我正在尝试创建一个颜色菜单,但最后一行报告了一些错误。
puts("I don't know about the color %c",input);
Run Code Online (Sandbox Code Playgroud)
这是声明
char input[7];
Run Code Online (Sandbox Code Playgroud)
和初始化
scanf("%c",&input);
Run Code Online (Sandbox Code Playgroud)
错误在这里
Too many arguments in function call
error: expected declaration specifiers or '...' before '&' token
scanf("%c",&input);
^
error: expected declaration specifiers or '...' before string constant
scanf("%c",&input);
^~~~
Run Code Online (Sandbox Code Playgroud)
为什么?