1 #include 2 #include 3 #include 4 #include 5 6 #define BUFFER_SIZE 2 7 struct prodcons 8 { 9 int buffer[BUFFER_SIZE]; 10 pthre...
分类:
编程语言 时间:
2014-06-18 21:15:32
阅读次数:
223
1、函数指针使用示例typedef void (*FPFunc) ();void func() {}int main(){ FPFunc pFunc = func; pFunc();}2、类成员函数指针使用示例class C {public: typedef void (C::*FP...
分类:
其他好文 时间:
2014-06-18 21:11:21
阅读次数:
162
#include typedef GLfloat point2d[2]; // a point data type void triangle( point2d a, point2d b, point2d c) // display a triangle { glBegin(GL_TRIANGLES...
分类:
其他好文 时间:
2014-06-18 21:02:32
阅读次数:
334
自己统计流量的话 需要判断是3G访问还是WIFI访问用 NSURLProtocol自定义一个这个累计DATA就是下行流量#include #include #include #include BOOL success; struct ifaddrs *addrs; const struc...
分类:
移动开发 时间:
2014-06-18 20:51:23
阅读次数:
323
课程设计用归并排序出现了一些有趣的问题, 首先是B题, 配套的代码第41行S相当于临时空间, 1 #include 2 using namespace std; 3 #define MAXSIZE 1000001 4 typedef s...
分类:
其他好文 时间:
2014-06-18 19:59:04
阅读次数:
261
结构体结构体是一种自定义的数据类型struct 结构体名{ 类型说明符 成员名; … 类型说明符 成员名;};#import int main(int argc, const char * argv[]){ struct teacher{ char name[30]; ...
分类:
移动开发 时间:
2014-06-18 19:42:08
阅读次数:
413
这里实现一个简单的多媒体数据流的处理库,它是以Filter的思想来实现的,通过Filter可以实现多路数据采集,处理和输出;一. 如何实现一个filter1.定义一个Filter descripter 结构,它包含了Filter的主要属性和行为;typedef struct McFilterDesc...
分类:
其他好文 时间:
2014-06-18 17:14:32
阅读次数:
202
1.PyListObject对象 --> 变长可变对象,可看作vector
typedef struct{
PyObject_VAR_HEAD //其中的ob_size表示实际被使用的内存的数量
PyObject **ob_item;//ob_item为指向元素列表的指针,实际上,Python中的list[0]就是ob_item[0]
int allocated;//当前列表中可容纳的元素的总数
}
PyList_Type 对象 --> PyListObject的类型对象
ty...
分类:
编程语言 时间:
2014-06-16 22:48:55
阅读次数:
300
许多文件系统都是通过generic_file_write()函数来实现文件对象的write方法,即write(库函数)->sys_write()->generic_file_write():
ssize_t generic_file_write(struct file *file, const char __user *buf,
size_t count, loff_t *ppos)...
分类:
其他好文 时间:
2014-06-16 22:47:52
阅读次数:
203