readdir()在多线程操作中不安全,Linux提供了readdir_r()实现多线程读取目录内容操作。#include
#include #include int main(void){ DIR* dirp; struct dirent
*dp1=malloc(sizeof(stru...
分类:
其他好文 时间:
2014-05-12 13:34:35
阅读次数:
914
偷西瓜
时间限制:1000 ms | 内存限制:65535 KB
难度:4
描述
对于农村的孩子来说最大的乐趣,莫过于和小伙伴们一块下地偷西瓜了,虽然孩子们条件不是很好,但是往往他们很聪明,他们总在计算着到达瓜田的距离,以及逃跑的路线,他们总是以最短的距离冲到瓜田里面,然后以最短的距离回到出发的地方,不过瓜田的大人们已经在他们来的路上等待他们。于是聪明的小伙伴们...
分类:
其他好文 时间:
2014-05-12 07:13:05
阅读次数:
383
#include#includetypedef struct node { int data;
struct node *lchild,*rchild;};node * create()//先序建立二叉树,根左右{ int x=0; node *t;
printf(" input data:"); ...
分类:
其他好文 时间:
2014-05-11 01:19:08
阅读次数:
311
基于mysql数据库整合框架时出现的数据库字符编码的问题.
解决办法:数据库驱动的版本太高,换成低版本的,主要还是你的架包太不是最新版本,出现的兼容性问题。
分类:
编程语言 时间:
2014-05-10 18:13:53
阅读次数:
473
Microsoft Dynamics AX 2012R2
,今天重装了服务器.重装后,导入项目A报错:A table, Extended Data Type, Base Enum or class called
???? already exists.每次重装,AOT中的元素ID都会重新生成,可能是...
分类:
其他好文 时间:
2014-05-10 07:53:57
阅读次数:
243
在C++中用到map时,如果KEY是自定义的struct,那么需要自己定义比较函数。因为只有基本类型有默认的比较方法。定义的方法有两种,一是在作为key的struct中,重载操作符less(
UrlMap; UrlKey stKey; stKey.dwBussID = 1; stKey.dwV...
分类:
编程语言 时间:
2014-05-10 06:10:26
阅读次数:
332
在下例中,演示了链表的各种操作
#include
using namespace std;
typedef struct Node
{
int data; //数据域
struct Node * next; //指针域
}NODE, *PNODE; //NODE相当于struct Node, PNODE相当于struct Node *
PNODE CreateList()...
分类:
其他好文 时间:
2014-05-10 04:29:49
阅读次数:
263
Redis的client设计如下:
/* With multiplexing we need to take per-clinet state.
* Clients are taken in a liked list. */
typedef struct redisClient {
int fd;
redisDb *db;
int dictid;
sds que...
分类:
其他好文 时间:
2014-05-10 03:44:21
阅读次数:
292
题目:意思就是判断给定的几条线段是否有相交的。
方法:模版吧,有空在来细细学习。
代码:
#include
#include
using namespace std;
struct Point
{
double x,y;
};
struct LineSeg
{
Point a,b;
};
double Cross(Point a, Point b, Poi...
分类:
其他好文 时间:
2014-05-10 03:39:07
阅读次数:
326
1.usb能够进行基本的工作,包括基本的GPIO的配置。寄存器地址的设定。中断的设定。
设定好了以后要求能够进行最基本的usb的功能,比如U盘
2.需要一些文件节点来控制该usb host
驱动,以及相应的节点读写寄存器,方便调试的文件节点。
2.USB enumeration的稳定性。要求每次enumeration都要成功。
isp1763就发现有些modem卡不能enum...
分类:
其他好文 时间:
2014-05-09 21:47:44
阅读次数:
355