sockaddr结构体sockaddr的缺陷:struct sockaddr 是一个通用地址结构,这是为了统一地址结构的表示方法,统一接口函数,使不同的地址结构可以被bind() , connect() 等函数调用;sa_data把目标地址和端口信息混在一起了struct sockaddr { un...
分类:
其他好文 时间:
2014-07-16 19:22:47
阅读次数:
232
在安装完keystone并利用keystone-manage命令同步数据库后,mysql(我使用的存储后端)中新加了如下表: assignment:type enum('UserProject','GroupProject','UserDomain','GroupDomain')...
分类:
数据库 时间:
2014-07-16 19:16:07
阅读次数:
307
BFS。 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 #define MAXN 305 8 9 typedef struct node_st {10 int x, y;11 ...
分类:
其他好文 时间:
2014-07-15 23:05:28
阅读次数:
289
1.字节边界对齐 提高读写速度2.构造函数尽量使用初始化列表(不然对象类型会有一次默认构造 初始值)3.尽量使用前置++ ,因为后置++会生成临时对象4.不要用结构体着函数返回值 struct a; a=f(1) ; 会生成临时对象 struct a = f(1); 这样不会生成临时对象5....
分类:
其他好文 时间:
2014-07-15 22:57:36
阅读次数:
313
经验:Traits classes 使得"类型相关信息"在编译期可用。它们以 templates 和 "templates 特化"完成实现
示例:
template
class deque{
public:
class iterator{
public:
typedef random_access_iterator_tag iterator_category;
};
};
//template
template
struct iterator_trai...
分类:
编程语言 时间:
2014-07-15 22:40:20
阅读次数:
372
1.结点
链表中用来存储一个数据的存储单元。
一个链表至少需要由两部分组成,就是数据域和指针域,一般形式的结点定义为:
struct node
{
Elem data; //Elem类型泛指基本数据类型
struct node *next;
}
typedef struct node Elemsn;
以上两步等价于:
typedef struct node
{...
分类:
其他好文 时间:
2014-07-15 13:01:24
阅读次数:
281
将兔子的血量从小到大排序,箭的威力也从小到大排序,
对于每只兔子将威力大于血量的箭加入队列,写个优先队列使得出来数位价钱最少。。
#include
#include
#include
#include
#include
using namespace std;
const int maxn=100010;
struct tt
{
int d;
int p;
bool operator<...
分类:
其他好文 时间:
2014-07-15 12:52:52
阅读次数:
321
CCDirector是控制游戏流程的主要组件。 1 typedef enum { 2 /// sets a 2D projection (orthogonal projection)2D投机模式 3 kCCDirectorProjection2D, 4 5...
分类:
其他好文 时间:
2014-07-15 08:12:00
阅读次数:
556
#includevoid main(){const int count = 5;//定义数量struct student{char name[80];float math,eng;float aver;}stu[count],temp;//输入for (int i = 0; i stu[sub].a...
分类:
编程语言 时间:
2014-07-14 21:23:30
阅读次数:
247
#include
#include
#include
using namespace std;
#define inf 0x7ffffff
struct Edge
{
int u,v,cost;
}edge[2000];
int pre[200];//父亲
int dis[200];//到源点的距离
int n,m,src;//点的个数,边数,源点
bool relax(int...
分类:
其他好文 时间:
2014-07-14 12:59:28
阅读次数:
265