tic-tac-toe游戏c语言,Tic-Tac-Toe游戏的C语言二维数组为什么出错**

Tic-Tac-Toe游戏的C语言二维数组为什么出错*

第一个错误:8 22 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] use of parameter outside function body before ‘]’ token

第二个错误:35 22 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

第三个错误:40 8 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘a’ was not declared in this scope

#include /*Tic-Tac-Toe游戏,主函数输入一个棋盘规模大小,

然后接着输入目前棋盘的形态,

然后调用judge函数,判断游戏是否结束的简单小游戏程序。

主要考察二维数组和标记变量的知识点。*/

int judge(int num,int a[num][num]); //函数声明

int main(void){

int num; //棋盘的大小

while (scanf("%d", &num) != EOF) //这是什么判断?

{

int a[num][num]; //输入棋盘内的数字

for(int i=0; i

8 28 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] use of parameter outside function body before ‘]’ token

8 33 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] use of parameter outside function body before ‘]’ token

32 28 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] use of parameter outside function body before ‘]’ token

32 33 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] use of parameter outside function body before ‘]’ token

I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp In function ‘int judge(…)’:

35 22 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

40 8 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘a’ was not declared in this scope

53 23 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

58 9 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘a’ was not declared in this scope

74 19 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

76 8 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘a’ was not declared in this scope

82 12 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

90 19 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

92 8 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘a’ was not declared in this scope

98 12 I:\C语言学习文件\学习\Tic-tac-toe游戏网上版.cpp [Error] ‘num’ was not declared in this scope

a 和num 在函数声明中都定义了int 类型了呀

为什么还会出错**

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值