
c语言学习
文章平均质量分 80
wangst4321
安静地翱翔,有翅膀就应该去飞翔
展开
-
typedef重定义错误
记录一个问题。 Item.h文件: typedef int Item; Link.h文件: #include "Item.h" void LINKinit(int); Link.c文件: #include "stdio.h" #include "Link.h" #inlcude "Item.h" void LINKint(int n) {原创 2013-01-10 10:23:08 · 8265 阅读 · 0 评论 -
非阻塞io和IO多路转接
本文参考《Unix高级环境编程》,仅用于个人学习,备忘。 1. sample 学习代码 #include #include #include #include #include #include #include #define MAXLINE 500000 void set_fl(int, int); void clr_fl(int, int); int main(v原创 2013-03-22 07:50:35 · 1126 阅读 · 0 评论 -
文件锁
1. sample学习代码 #include #include #include #include #include #include #define read_lock(fd, offset, whence, len) \ lock_reg((fd), F_SETLK, F_RDLCK, (offset), (whence), (len)) #define原创 2013-03-28 00:45:26 · 807 阅读 · 0 评论 -
socket编程缓冲区大小对send()的影响
1. 概述 Socket编程中,使用send()传送数据时,返回结果受到以下几个因素的影响: • Blocking模式或non-blocking模式 • 发送缓冲区的大小 • 接收窗口大小 本文档介绍通过实验的方式,得出(收发)缓冲区大小对send结果的影响。实验使用C语言。 2 数据发送和接收的过程 如下图所示,程序调用send()发送数据时,数据将首先进入发送缓冲区,等待发送。系原创 2013-04-11 18:57:46 · 15312 阅读 · 1 评论 -
python处理中文字符
1.在py文件中使用中文字符 unicode.py文件内容如下所示: # -*- coding:utf-8 -*- str_ch = '我们women' uni_ch = u'我们women' print "type:", type(str_ch), "content:", str_ch, repr(str_ch) print "type:", type(uni_ch), "conten原创 2013-08-20 18:17:07 · 1601 阅读 · 0 评论