#include<stdio.h>
#include<stdlib.h>
#include"point.h"
#include<stdbool.h>
struct TreereeNode{
int dim,index;
bool left,right;
}tree[MAXN];
int sortDimension;
bool compare(int x,int y){
return point[x].p[sortDimension]<point[y].p[sortDimension];
}
它说我compare有错~不是说用<stdbool.h>这个头文件后可以用bool型么
[mw_shl_code=c,true]
#include<stdio.h>
#include<stdlib.h>
#include"point.h"
#include<stdbool.h>
struct TreereeNode{
int dim,index;
bool left,right;
}tree[MAXN];
int sortDimension;
int compare(const void *a,const void *b){
struct Point *aa=(Point *)a;
struct Point *bb=(Point *)b;
return(((aa->p[sortDimension])>(bb->p[sortDimension]))?-1:1);
}[/mw_shl_code]
buildTree.c: In function ‘compare’:
buildTree.c:12: error: ‘Point’ undeclared (first use in this function)
buildTree.c:12: error: (Each undeclared identifier is reported only once
buildTree.c:12: error: for each function it appears in.)
buildTree.c:12: error: expected expression before ‘)’ token
buildTree.c:13: error: expected expression before ‘)’ token
Point我在前边point.h里有啊,怎么破~~
[查看全文]
