作业帮 > 综合 > 作业

different types for formal and actual parameter 1

来源:学生作业帮 编辑:搜狗做题网作业帮 分类:综合作业 时间:2024/05/17 01:08:08
different types for formal and actual parameter 1
#include "stdio.h"
#define FINITY 5000 //此处用5000代表无穷大
#define m 20
typedef char vertextype;
typedef int edgetype;
typedef struct{
vertextype vexs[m];
edgetype edges[m][m];
int n,e;
}Mgraph;
void creat(Mgraph g,char *s,int c)
{
int i,j,k,w;
FILE *rf;
rf=fopen(s,"r");
if (rf)
{
fscanf(rf,"%d%d",&g.n,&g.e);
for (i=0;i
different types for formal and actual parameter 1
是第一个参数错了,不是第二个,你定义函数的时候第一个参数是Mgraph g,而你调用的时候用的时 &g
第二个参数的话,只要加上(char *)filename进行强制类型转换就行