一个错误~怎么改呢(旅行员售货问题)
#define NoEdge 1000
struct MinHeapNode
{
int lcost; //子树费用的下界
int cc; //当前费用
int rcost; //x[s:n-1]中顶点最小出边费用和
int s; //根节点到当前节点的路径为x[0:s]
int *x; //需要进一步搜索的顶点是//x[s+1:n-1]
struct MinHeapNode *next;
};
int n; //图G的顶点数
int **a; //图G的邻接矩阵
int bestc;
MinHeapNode* head = 0; /*堆头*/
MinHeapNode* lq = 0; /*堆第一个元素*/
MinHeapNode* fq = 0; /*堆最后一个元素*/
int DeleteMin(MinHeapNode*&E);
int Insert(MinHeapNode* hn);
int BBTSP(int v[]);
#include"travelor.h"
int main()
{
n = 0;
int i = 0;
FILE *in, *out;
in = fopen_s(&in,"filename","r");
out = fopen_s(&out,"filename","w");
if(in == NULL || out == NULL)
{
printf("没有输入输出文件\n");
return 1;
}
fscanf(in, "%d", &n);
a = (int**)malloc(sizeof(int*) * (n + 1));
for(i = 1; i <= n; i++)
{
a[i] = (int*)malloc(sizeof(int) * (n + 1));
}
for(i = 1; i <= n; i++)
for(int j = 1; j <= n; j++)
fscanf(in, "%d", &a[i][j]);
// prev = (int*)malloc(sizeof(int)*(n+1)) ;
int*v = (int*)malloc(sizeof(int) * (n + 1));// MaxLoading(w , c , n) ;
for(i = 1; i <= n; i++)
v[i] = 0;
bestc = BBTSP(v);
for(i = 1; i <= n; i++)
fprintf(stdout, "%d\t", v[i]);
fprintf(stdout, "\n");
fprintf(stdout, "%d\n", bestc);
system("pause");
return 0;
}
error C2440: “=”: 无法从“errno_t”转换为“FILE *”