【发布时间】:2016-10-22 16:43:21
【问题描述】:
#include <stdio.h>
#include <string.h>
const int STRING_SIZE = 40;
typedef char string[STRING_SIZE];
char typeInput(string message);
int main()
{
typeInput("Hi my name is Sean");
}
char typeInput(string message)
{
printf(" %s", message);
}
错误:在文件范围内可变地修改了“字符串” 由于某种原因,我不断收到此错误。我哪里做错了?
编辑: 以防万一我使用代码块
【问题讨论】:
-
我将char变量命名为“string”
-
等等什么意思(菜鸟程序员)
-
const int STRING_SIZE = 40;-->#define STRING_SIZE 40。还将typeInput的返回类型从char更改为void。
标签: c