会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
黑马网仔
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
11
12
13
14
15
16
下一页
2017年11月2日
C++红黑树
摘要: 1 #ifndef _RBTREE_H_ 2 #define _RBTREE_H_ 3 4 const int nodeSize = 3; 5 class RBTree 6 { 7 private: 8 typedef struct Node { 9 int key; 10 int color; /
阅读全文
posted @ 2017-11-02 21:28 黑马网仔
阅读(403)
评论(0)
推荐(0)
2017年10月17日
c++二叉树
摘要: 1 #ifndef _TREE_H_ 2 #define _TREE_H_ 3 //此类用shared_ptr来管理节点内存,所以要包含<memory>头文件,不需要手动释放内存 4 #include <memory> 5 #include <iostream> 6 7 using namespac
阅读全文
posted @ 2017-10-17 17:05 黑马网仔
阅读(252)
评论(0)
推荐(0)
2017年10月12日
用C++写的带模板双向链表
摘要: 1 #ifndef _BLIST_H_ 2 #define _BLIST_H_ 3 4 #include <iostream> 5 6 using namespace std; 7 8 template<class T> 9 class List{ 10 11 private: 12 class N
阅读全文
posted @ 2017-10-12 01:40 黑马网仔
阅读(988)
评论(0)
推荐(0)
2017年10月10日
C语言 带比较器的归并排序
摘要: 1 #include <stdio.h> 2 #include <stdlib.h> 3 4 typedef int DataType; 5 6 //比较器 7 int mycmp(const void * a, const void *b); 8 9 //int (*compar)(const v
阅读全文
posted @ 2017-10-10 23:39 黑马网仔
阅读(247)
评论(0)
推荐(0)
自己用C写的list双向链表
摘要: 自己用C写的list双向链表头文件 1 #ifndef _LIST_H_ 2 #define _LIST_H_ 3 4 #include <stdlib.h> 5 #include <stdio.h> 6 #include <stdbool.h> 7 8 typedef int DataType;
阅读全文
posted @ 2017-10-10 20:19 黑马网仔
阅读(286)
评论(0)
推荐(0)
2017年6月11日
已知1800年1月1日是星期三,打印指定的年份和月份月历
摘要: #ifndef CALENDAR_H_ #define CALENDAR_H_ #include <string> #include <iostream> #include <stdio.h> void showCalendar(int year, int month); void showHead
阅读全文
posted @ 2017-06-11 17:20 黑马网仔
阅读(1067)
评论(0)
推荐(0)
2017年5月8日
c C++ IO
摘要: 基于C的文件操作 在ANSI C中,对文件的操作分为两种方式,即流式文件操作和I/O文件操作,下面就分别介绍之。一、流式文件操作这种方式的文件操作有一个重要的结构FILE,FILE在头文件stdio.h中定义如下:typedef struct {int level; /* fill/empty le
阅读全文
posted @ 2017-05-08 03:46 黑马网仔
阅读(350)
评论(0)
推荐(0)
2017年5月7日
fread(),fwrite()函数
摘要: fread(buf,size,nmemb,fp): 从fp中将nmemb个size字节的内容读入到buf缓冲区中。如果没遇到文件结尾,其返回值应等于nmemb,否则返回实际读取的大小。 fwrite(buf,size,nmemb,fp); 将buf缓冲区中读取的nmemb个size字节的内容写入fp
阅读全文
posted @ 2017-05-07 22:28 黑马网仔
阅读(425)
评论(0)
推荐(0)
随机存取:fseek(),ftell()
摘要: 随机存取:fseek(),ftell() fseek(fp,offset,pos): 文件指针定位,fp指向被打开的文件,offset为相对当前pos位置的偏移量,正数表示 向文件尾部偏移,负数表示向文件头部偏移。pos有三种状态, 分别为SEEK_SET(0)文件开始;SEEK_CUR(1)当前位
阅读全文
posted @ 2017-05-07 18:13 黑马网仔
阅读(199)
评论(0)
推荐(0)
C 将文本文件内容逆序打印
摘要: 方法一:文件指针固定,依靠偏移量来访问文件内容 方法二: 偏移量固定,依靠SEEK_CUR当前指针来访问文件内容
阅读全文
posted @ 2017-05-07 18:08 黑马网仔
阅读(538)
评论(0)
推荐(0)
上一页
1
···
11
12
13
14
15
16
下一页
公告