动态链表的建立,输出,删除,插入
#include
#include
#include
#define NULL 0
#define LEN sizeof(struct student)
struct student
{
long num;
float score;
struct student*next;
};
int n;/*n为全...
分类:
其他好文 时间:
2014-07-12 23:23:33
阅读次数:
183
好吧。。
直接上模板。。。
queue q;
memset(flow,0,sizeof(flow));
int f = 0;
while(true){
memset(a,0,sizeof(a));
a[s] = INF;
q.push(s);
while(!q.empty)){ //BFS找增广路...
分类:
其他好文 时间:
2014-07-12 20:03:00
阅读次数:
244
用邻接矩阵写的。自己慢慢理解吧#include #include using namespace std;#define CC(c) memset(c, 0, sizeof(c))const int maxn=5000;int iscut[maxn], g[maxn][maxn], low[maxn...
分类:
其他好文 时间:
2014-07-11 08:45:04
阅读次数:
206
1、MFC中点出对话框显示另存为的一个路径和文件:
void CPatchDlg::OnBnClickedBtnPath()
{
//一下为选择另存为一个路径
m_strSavepath = "";
BROWSEINFO bi;
ZeroMemory(&bi, sizeof(BROWSEINFO));
bi.hwndOwner = m_hWnd;
bi.ulFlags = BIF_...
分类:
编程语言 时间:
2014-07-10 23:51:47
阅读次数:
323
在对话框初始化过程中将设备通知消息注册到winproc中
//Register to receive notification when a USB device is plugged in.
broadcastInterface.dbcc_size =sizeof(DEV_BROADCAST_DEVICEINTERFACE);
broadcastInterface.dbcc_devicet...
分类:
其他好文 时间:
2014-07-10 21:49:41
阅读次数:
338
一些规则1.c++不允许用户自己定义新的运算符,只能对已有的c++运算符进行重载。2.除了五个运算符不允许重载外,其他运算符允许重载:.成员访问运算符*成员指针访问运算符::与运算符sizeof尺寸运算符?:条件运算符3.重载运算符必须和用户定义的自定义类型的对象一起使用。(也就是说,参数不能全部都...
分类:
编程语言 时间:
2014-07-09 13:56:27
阅读次数:
286
之前很傻,,感觉看不到拓扑是啥东西。。脑子太烂了吧。。。今晚上瞄了一眼就懂了。。我就放代码上来就行了。。注释也不打了,,因为太简单了。#include #include using namespace std;#define CC(i) memset(i, 0, sizeof(i))const in...
分类:
其他好文 时间:
2014-07-09 13:33:27
阅读次数:
235
glusterfs中的内存管理方式: 1 struct mem_pool * 2 mem_pool_new_fn (unsigned long sizeof_type, 3 unsigned long count, char *name) 4 { 5 ...
分类:
其他好文 时间:
2014-07-08 21:50:47
阅读次数:
441
代码注释比较详细:
#include
#include
using namespace std;
struct Node{
int data;
Node* next;
};
Node* head = NULL;
bool create() {
head = (Node*)malloc(sizeof(Node));
if(NULL == head) return false;...
分类:
其他好文 时间:
2014-07-08 21:05:05
阅读次数:
238
指针即为地址,存的是变量的地址,在同一架构下地址长度都是相同的(cpu的最大寻址内存空间),所以不同类型的指针长度都一样。指针占用几个字节跟语言无关,而是跟系统的寻址能力有关,16为地址指针即为2个字节,32位系统是4个字节,64位系统为8个字节。用sizeof求长度:#includevoid ma...
分类:
编程语言 时间:
2014-07-08 11:44:53
阅读次数:
273