- 博客(2)
- 收藏
- 关注
原创 C++ sort 对结构体进行排序
在C++中,对自定义的结构体进行排序,需要自定义一个称为比较器的函数(下面代码中的comparison函数)#include <iostream> #include <vector>#include <algorithm>using namespace std;struct Point { int x; int y; Point(int x, int y) : x(x)
2016-11-07 10:12:04 5301
原创 C/C++ struct 结构体定义 用法详解
在C语言中,定义一个结构体类型要用typedef :typedef struct point { int x; int y;}Point;在声明变量的时候就可以:Point p1;在声明变量的时候就必须用:struct point p1;
2016-11-07 09:35:41 32626 1
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人