1、定义与C++对应的C#结构体 在c#中的结构体不能定义指针,不能定义字符数组,只能在里面定义字符数组的引用。 C++的消息结构体如下: //消息格式 4+16+4+4= 28个字节 struct cs_message{ u32_t cmd_type; char username[16]; u32...
分类:
其他好文 时间:
2014-06-25 18:56:03
阅读次数:
254
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-06-25 18:42:46
阅读次数:
172
/** * Definition for binary tree * struct TreeNode { * int val; * TreeNode *left; * TreeNode *right; * TreeNode(int x) : val(x), left(...
分类:
其他好文 时间:
2014-06-25 18:40:08
阅读次数:
182
Linux是一个多用户,多任务的系统,可以同时运行多个用户的多个程序,就必然会产生很多的进程,而每个进程会有不同的状态。Linux进程状态:R (TASK_RUNNING),可执行状态。只有在该状态的进程才可能在CPU上运行。而同一时刻可能有多个进程处于可执行状态,这些进程的task_struct结...
分类:
Web程序 时间:
2014-06-25 16:04:52
阅读次数:
384
#include#include "fatal.h"struct AvlNode;typedef struct AvlNode *Position;typedef struct AvlNode *AvlTree;typedef int ElementType ;AvlTree MakeEmpty(A...
分类:
编程语言 时间:
2014-06-25 13:23:40
阅读次数:
267
#include#include "fatal.h"struct TreeNode;typedef struct TreeNode *Position;typedef struct TreeNode *SearchTree;typedef int ElementType;SearchTree Mak...
分类:
编程语言 时间:
2014-06-25 12:53:17
阅读次数:
334
attribute method:
#include
struct packed
{
char a;
int b;
} __attribute__((packed));
struct not_packed
{
char a;
int b;
};
int main(void)
{
printf("Packed: %zu\n", sizeof(...
分类:
其他好文 时间:
2014-06-25 07:29:49
阅读次数:
155
当Nginx检测到配置文件中存在配置块http{}时,会建立一个ngx_http_conf_ctx_t结构体,该结构体定义如下:
typedef struct {
void **main_conf; // 每个指针元素指向所有由HTTP模块的create_main_conf方法产生的结构体
void **srv_conf; // 每个指针...
分类:
其他好文 时间:
2014-06-25 06:57:04
阅读次数:
233
1.Python虚拟机在执行函数调用时会动态地创建新的 PyFrameObject对象,
这些PyFrameObject对象之间会形成PyFrameObject对象链,模拟x86平台上运行时栈
2.PyFuctionObject对象
typedef struct {
PyObject_HEAD
PyObject *func_code; //对应函数编译后的PyCodeObject对象
PyObject *func_globals; //函数运行时的global空间
PyObject *func_...
分类:
编程语言 时间:
2014-06-24 21:56:10
阅读次数:
415
Intersecting Lines
大意:给你两条直线的坐标,判断两条直线是否共线、平行、相交,若相交,求出交点。
思路:线段相交判断、求交点的水题,没什么好说的。
struct Point{
double x, y;
} ;
struct Line{
Point a, b;
} A, B;
double xmult(Point p1, Point...
分类:
其他好文 时间:
2014-06-24 21:16:40
阅读次数:
155