今天看到下面这两个函数:struct resource
*platform_get_resource(struct platform_device *dev, unsigned int type, unsigned
int num){ int i; for (i = 0; i n...
分类:
系统相关 时间:
2014-06-02 22:15:28
阅读次数:
438
关于C++字节对齐问题关于C/C++的字节对齐这两天写解析SWF文件的程序,在结构体指针和从文件里读出来的进行转换的时候遇到一些问题,就是有一个struct
A,比如:struct A{ char flag; int length; int id; ....};然后一个飘逸的...
分类:
编程语言 时间:
2014-06-02 21:23:39
阅读次数:
260
BFS+状态压缩,做了很多状态压缩了。今晚把八数码问题给搞定了。 1 #include 2
#include 3 #include 4 #include 5 using namespace std; 6 7 typedef struct node_st
{ 8 int x, y, ...
分类:
其他好文 时间:
2014-06-02 17:14:38
阅读次数:
232
下面就介绍这个模块中的几个方法。 struct.pack():我的理解是,python利用
struct模块将字符(比如说 int,long ,unsized int 等)拆成 字节流(用十六进制表示),便于传输。
其函数原型为:struct.pack(fmt, v1, v2, ...),fmt表示...
分类:
编程语言 时间:
2014-06-02 17:13:12
阅读次数:
253
class B;struct A{ B* ptr;};class B{public:};int
main(){ return 0;}A中定义了B的指针,所以要声明class
B,在定义处于不完整类型之前,只能使用类的指针或者引用,在定义B之前是不能调用B的成员的。好像还有一些细节。
分类:
编程语言 时间:
2014-06-02 16:39:52
阅读次数:
218
函数指针即为指向一个函数的指针。要定义一个函数指针,只需将需要指向的函数的原型中函数名的前面加一个"*"号即可。比如,函数foo的原型为:int
foo(int, char, struct node);那么要建立一个指向foo的指针,名为bar,就可以这样写:int (*bar)(int, char...
分类:
其他好文 时间:
2014-06-02 06:15:10
阅读次数:
218
typedef struct node//该结构体代表一个结点{ int data;
//结点的数据域 struct node *next; //结点的指针域}lnode,*linklist;
//定义一个结构体变量和指向结构体的指针//用头插法创建一个链表linklist ...
分类:
其他好文 时间:
2014-06-02 05:50:31
阅读次数:
341
在整理Java LockSupport.park()的东东,看到了个"Spurious wakeup",重新梳理下。
首先来个《UNIX环境高级编程》里的例子:
#include
struct msg {
struct msg *m_next;
/* ... more stuff here ... */
};
struct msg *workq;
pthread_cond_t qread...
分类:
其他好文 时间:
2014-06-02 04:45:19
阅读次数:
267
递归一下
/**
* Definition for singly-linked list.
* struct ListNode {
* int val;
* ListNode *next;
* ListNode(int x) : val(x), next(NULL) {}
* };
*/
class Solution {
public:
Li...
分类:
其他好文 时间:
2014-06-01 17:35:40
阅读次数:
406
/***数据结构串的操作,有增删改查*串的初始化以及串的赋值等操作必须注意,在新学的时候必须注意值得传递,指针的指向以及初始化的结果*///操作效果图:代码://串的静态存储结构/**静态数组存储结构typedef
struct{ char str[MaxSize]; int l...
分类:
其他好文 时间:
2014-06-01 12:18:54
阅读次数:
292