Yak*_*kov 2 c arrays struct arguments
我有以下代码声明:
struct coord {
int x;
int y;
}
void rotateFig(struct coord[10][10]);
Run Code Online (Sandbox Code Playgroud)
我需要实施rotateFig.我试着从以下开始:
void rotateFig(struct coord[10][10] c)
{
//code
}
Run Code Online (Sandbox Code Playgroud)
我不能编译它 - 可能我在函数定义中传递c的方式是不正确的.如何使用给定签名传输c.谢谢
使用此定义:
void rotateFig(struct coord c[10][10])
{
//code
}
Run Code Online (Sandbox Code Playgroud)
数组是实际参数,因此维度必须在其名称之后,而不是之前.