添加重要的命名空间:using
System.Runtime.InteropServices;先建立结构相同(char长度相同)的Struct类型用于转换:[StructLayout(LayoutKind.Sequential,
Pack = 1)] public struct Employe...
分类:
其他好文 时间:
2014-05-26 23:25:14
阅读次数:
302
已经无法再精简,适合入门。 1 #include 2 #include 3 4
#include 5 #include 6 #include 7 #include 8 struct mengc_dev{ 9 char data[64];10
struct cdev...
分类:
系统相关 时间:
2014-05-26 22:52:42
阅读次数:
371
二叉树非递归访问,借助一个栈,来模拟递归调用过程。struct TreeNode { char
val; TreeNode *left; TreeNode *right; TreeNode(int x) : val(x), left(NULL),
right(NULL...
分类:
其他好文 时间:
2014-05-26 22:25:25
阅读次数:
353
转自:http://www.cppblog.com/liangbo/archive/2006/10/06/13394.html1.sizeof操作符的结果类型是size_t,它在头文件中typedef为unsigned int类型。该类型保证能容纳实现所建立的最大对象的字节大小。2.sizeof是算...
分类:
其他好文 时间:
2014-05-26 21:01:12
阅读次数:
250
不能再简化 1 #include 2 #include 3 4 #include 5 #include
6 #include 7 void * meng_seq_start(struct seq_file*s,loff_t*pos) 8 { 9
if(*pos>1)10 ...
分类:
系统相关 时间:
2014-05-26 15:20:31
阅读次数:
351
无聊写了个单链表排序,不是很难。但是插入写起来很麻烦,都没有,本文全部是将链表中节点值互换,不改变结构,所以很容易写出来 #includeusing
namespace std;struct node{ int n; struct node* next;};//创建链表void swap(int
&...
分类:
其他好文 时间:
2014-05-26 14:52:14
阅读次数:
227
链表struct Node{int data;//数据域struct Node
*next;//指针域};//基本操作:创建,插入,删除,打印[百科示例]无需事先知晓链表数据的长度,充分利用内存空间,事先灵活的内存动态管理。链表允许插入和移除表上任意位置上的节点,但是不允许随机存取。因为它包含指向另...
分类:
其他好文 时间:
2014-05-26 14:16:31
阅读次数:
357
参照书上写的Huffman树的代码 结构用的是线性存储的结构 不是二叉链表
里面要用到查找最小和第二小 理论上锦标赛法比较好 但是实现好麻烦啊 考虑到数据量不是很大 就直接用比较笨的先找最小 去掉最小再找第二小的方法了。#include
#include #include typedef struc...
分类:
其他好文 时间:
2014-05-26 14:00:45
阅读次数:
256
#include#include#include#include using namespace
std;template class joseph{ struct node { T data; node * next; node():next(...
分类:
编程语言 时间:
2014-05-26 13:58:27
阅读次数:
215
原文:http://blog.chinaunix.net/uid-25885064-id-3125167.html#include
#include #include #include #include int get_mac(char* mac){ int sockfd; struct
ifreq...
分类:
编程语言 时间:
2014-05-26 13:52:46
阅读次数:
285