问题描述
- C语言局部定义函数错误
-
D:Microsoft Visual StudioCommonMSDev98Bin1.cpp(237) : error C2601: 'work5_1' : local function definitions are illegalint work5_1 (int weekday,int totality)
{
int daycount;for(int blank=1;blank <= weekday;blank++) printf(" "); for(daycount=1;daycount <= totality;daycount++) { if(weekday > 6) { printf(" %d n"); weekday = 0; } else { printf(" %d ",daycount); weekday++; } } return weekday;
}
解决方案
blank 这种方式定义,只有C++才可以,C即便允许了(忘了有没有允许),很多编译器也还没有实现
解决方案二:
这看起来是没定义,你在头文件里加上
int work5_1 (int weekday,int totality);
即可
时间: 2024-12-23 00:28:16