结构体数组怎么做函数参数~在线等
请问各位高手,C里我定义了一个结构体数组#include"stdio.h"#defineN11#defined3structelement{intkey[d];intne...
请问各位高手,C里我定义了一个结构体数组
#include "stdio.h"
#define N 11
#define d 3
struct element
{
int key[d];
int next;
}sqlist[N]={
{{0,0,0},0},
{{2,7,8},0},
{{1,0,9},0},
{{0,6,3},0},
{{9,3,0},0},
{{5,8,9},0},
{{1,8,4},0},
{{5,0,5},0},
{{2,6,9},0},
{{0,0,8},0},
{{0,8,3},0}};
void aaa(?) 定义这个函数里我想调用那个sqlist结构体数组,那么括号里的形参该怎么写? 展开
#include "stdio.h"
#define N 11
#define d 3
struct element
{
int key[d];
int next;
}sqlist[N]={
{{0,0,0},0},
{{2,7,8},0},
{{1,0,9},0},
{{0,6,3},0},
{{9,3,0},0},
{{5,8,9},0},
{{1,8,4},0},
{{5,0,5},0},
{{2,6,9},0},
{{0,0,8},0},
{{0,8,3},0}};
void aaa(?) 定义这个函数里我想调用那个sqlist结构体数组,那么括号里的形参该怎么写? 展开
2个回答
展开全部
#include "stdio.h"
#define N 11
#define d 3
struct element
{
int key[d];
int next;
}sqlist[N]={
{{0,0,0},0},
{{2,7,8},0},
{{1,0,9},0},
{{0,6,3},0},
{{9,3,0},0},
{{5,8,9},0},
{{1,8,4},0},
{{5,0,5},0},
{{2,6,9},0},
{{0,0,8},0},
{{0,8,3},0}};
void aaa(element sqlist[]);
void main()
{
aaa(sqlist);
}
void aaa(element sqlist[])
{
printf("%d",sqlist[2].key[2]);
}
#define N 11
#define d 3
struct element
{
int key[d];
int next;
}sqlist[N]={
{{0,0,0},0},
{{2,7,8},0},
{{1,0,9},0},
{{0,6,3},0},
{{9,3,0},0},
{{5,8,9},0},
{{1,8,4},0},
{{5,0,5},0},
{{2,6,9},0},
{{0,0,8},0},
{{0,8,3},0}};
void aaa(element sqlist[]);
void main()
{
aaa(sqlist);
}
void aaa(element sqlist[])
{
printf("%d",sqlist[2].key[2]);
}
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询