链表经典定义(C)
摘要:1 typedef struct Node 2 { 3 int data; 4 struct Node * next; 5 }NODE, * Linklist;以上这段代码几乎在任何数据结构教材中都会出现,纯正C风格的写法。1.struct Node{};定义了一个stuct Node类型的结构体(C语言规定结构体类型为struct Node,而不是Node);2.typdef struct Node NODE;有人觉得老写struct Node 有点烦,于是给struct Node 取了一个别名NODE;3.typedef Node * Linklist;由于最终...
阅读全文
将BMP格式的灰度图像或24位真彩图像二值化
摘要:1 /************************************************* 2 Author: 3 Date:2013-01-23 4 **************************************************/ 5 #include "stdafx.h" 6 //Visual studio 2010版中应该放到stdafx.h文件中的头文件们 7 #include<math.h> 8 #include <iomanip> 9 #include <stdlib.h> 10 #incl
阅读全文
jpegEncode
摘要:1 #include "Windows.h" 2 #include <stdio.h> 3 #include <iostream.h> 4 #include <fstream.h> 5 #include <stdlib.h> 6 #include <math.h> 7 #include <string.h> 8 9 int OUTBYTES=0; 10 11 //读入和存储bmp文件 12 unsigned char *pBmpBuf;//读入图像数据的指针 13 int bmpWidth; 14 in
阅读全文