我的程序有一系列的一样的结构体,我现在需要根据结构体中的一个属性(vector<POINT> points)的最大值来准确找到的是那个结构体,
typedef struct tagAREA
{
int id;
long size;
POINT center;
RECT rect;
vector<POINT> points;
BOOL flag;
} AREA;
求高手指点。
typedef struct tagAREA
{
int id;
long size;
POINT center;
RECT rect;
vector<POINT> points;
BOOL flag;
} AREA;
求高手指点。
//赋值...AREA maxPoint;
for(int i = 0 ; i < 9; i++)
{
//怎么比较POINT最大,自己具体实现,这里只比较横坐标
if(arArea[i].center.x > arArea[i+1].center)
{
maxPoint = arArea[i];
}
}最后maxPoint 就是最大值了。