different types for formal and actual parameter 1#include "stdio.h"#define FINITY 5000 //此处用5000代表无穷大#define m 20typedef char vertextype;typedef int edgetype;typedef struct{vertextype vexs[m];edgetype edges[m][m];int n,e;}Mgraph;void
来源:学生作业帮助网 编辑:六六作业网 时间:2024/12/26 12:44:20
different types for formal and actual parameter 1#include "stdio.h"#define FINITY 5000 //此处用5000代表无穷大#define m 20typedef char vertextype;typedef int edgetype;typedef struct{vertextype vexs[m];edgetype edges[m][m];int n,e;}Mgraph;void
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#include "stdio.h"#define FINITY 5000 //此处用5000代表无穷大#define m 20typedef char vertextype;typedef int edgetype;typedef struct{vertextype vexs[m];edgetype edges[m][m];int n,e;}Mgraph;void
是第一个参数错了,不是第二个,你定义函数的时候第一个参数是Mgraph g,而你调用的时候用的时 &g
第二个参数的话,只要加上(char *)filename进行强制类型转换就行