• 博客园logo
  • 会员
  • 周边
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
吴彦怡
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2014年9月17日

c/c++程序的预编译、编译、链接、运行
只有注册用户登录后才能阅读该文。 阅读全文
posted @ 2014-09-17 14:10 未过河的小卒 阅读(6) 评论(0) 推荐(0)
 
 

2014年8月28日

pthread_cond_wait()函数的理解(摘录)
摘要: /************pthread_cond_wait()的使用方法**********/pthread_mutex_lock(&qlock); /*lock*/pthread_cond_wait(&qready, &qlock); /*block-->unlock-->wait() ret... 阅读全文
posted @ 2014-08-28 19:18 未过河的小卒 阅读(335) 评论(0) 推荐(0)
 
 

2014年8月27日

linux下根据进程名字获取PID,类似pidof(转)
摘要: linux有一个命令行工具叫做pidof,可以根据用户输入的进程名字查找到进程号,但有时候我们需要在程序里实现,不想调用system,在查阅了很多版本的pidof源代码后,没有发现一个自己感觉比较好的,所以就参照linux上的pidof的源代码,改写出了一版,供大家参考使用。/***********... 阅读全文
posted @ 2014-08-27 16:57 未过河的小卒 阅读(2876) 评论(0) 推荐(0)
 
 

2014年8月22日

Linux下的网卡驱动程序的编写过程(转)
摘要: 工作需要写了我们公司一块网卡的linux驱动程序。经历一个从无到有的过程,深感技术交流的重要。Linux作为挑战微软垄断的强有力武器,日益受到大家的喜爱。真希望她能在中国迅速成长。把程序文档贴出来,希望和大家探讨Linux技术和应用,促进Linux在中国的普及。本文可随意转载,但请不要在盈利性出... 阅读全文
posted @ 2014-08-22 15:44 未过河的小卒 阅读(777) 评论(0) 推荐(0)
 
 

2014年8月3日

面试中的算法
摘要: 1. 编程实现:时间复杂度为O(n),空间复杂度为O(1),n个整数中除了两个数不重复外,其余的都出现了两次,编码实现如何找到那两个不重复的整数? 阅读全文
posted @ 2014-08-03 12:20 未过河的小卒 阅读(139) 评论(0) 推荐(0)
 
 

2014年2月28日

C语言标准库函数(网络上copy的)
摘要: C语言标准库函数标准io函数Standard C I/Oclearerr() clears errorsfclose() close a filefeof() true if at the end-of-fileferror() checks for a file errorfflush() writes the contents of the output bufferfgetc() get a character from a streamfgetpos() get the file position indicatorfgets() get a string of characters 阅读全文
posted @ 2014-02-28 17:36 未过河的小卒 阅读(499) 评论(0) 推荐(0)
 
opendir函数
摘要: #include #include DIR *dirptr = NULL; struct dirent *entry; dirptr = opendir("/cache/recovery/"); EL ("/cache/recovery"); if(dirptr == NULL) { ... 阅读全文
posted @ 2014-02-28 14:51 未过河的小卒 阅读(931) 评论(0) 推荐(0)
 
Linux Pthread 深入解析(转-度娘818)
摘要: Linux Pthread 深入解析Outline- 1.线程特点- 2.pthread创建- 3.pthread终止 - 4.mutex互斥量使用框架 - 5.cond条件变量 - 6.综合实例================================================================================================1. 线程特点线程拥有自己独立的栈、调度优先级和策略、信号屏蔽字(创建时继承)、errno变量以及线程私有数据。进程的其他地址空间均被所有线程所共享,因此线程可以访问程序的全局变量和堆中分配的数... 阅读全文
posted @ 2014-02-28 14:08 未过河的小卒 阅读(558) 评论(0) 推荐(0)
 
Linux下得到毫秒级时间--C语言实现(转-度娘818)
摘要: Linux下得到毫秒级时间--C语言实现原文链接:http://www.cnblogs.com/nwf5d/archive/2011/06/03/2071247.html#ifdef HAVE_CONFIG_H#include #endif#include #include #include int main(int argc, char *argv[]){printf("Hello, world!\n");struct timeval tvafter,tvpre;struct timezone tz;int sum = 0;int i=0;gettimeofday (&a 阅读全文
posted @ 2014-02-28 14:05 未过河的小卒 阅读(970) 评论(0) 推荐(0)
 
linux下c语言实现搜索根目录下所有文件(转-wangxiangshang)
摘要: 头文件:#include#includeopendir():函数原型:DIR * opendir(const char* path);打开一个目录,在失败的时候返回NULL(如果path对应的是文件,则返回NULL)DIR 结构体的原型为:struct_dirstream在linux系统中:typedef struct __dirstream DIR;struct __dirstream{void *__fd; /* `struct hurd_fd' pointer for descriptor. */char *__data; /* Directory block. */int __ 阅读全文
posted @ 2014-02-28 13:59 未过河的小卒 阅读(3171) 评论(0) 推荐(0)
 
 
下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3