- 博客(6)
- 收藏
- 关注
原创 学习笔记 2017-3-5
今天在研究给哈夫曼树反序编码时发现的,如下哈夫曼树的创建和编码#include#includeusing namespace std;int main(){ char s[10]="China"; char k[5]; k[5]='\0'; k[4]='1'; k[3]='6'; cout<<&s[1]<<endl;//结果hina cout<<&k[3];//结果61
2017-03-07 14:24:52 264
原创 学习笔记 2017-3-2
&是取地址运算符,&i是变量i的地址。一个变量的地址称为变量的指针。如果有一个变量专门用来存放地址(即指针)的,则它称为指针变量。如果把==错写成=的话,编译会完成,是不会有错误提示的。C++中return语句的用法二叉树:#include#includeusing namespace std;#define N 8int level=0;bool found
2017-03-02 18:59:27 279
原创 C++读取文件的问题
#include#include#define N 100struct student{ int x; int y;};using namespace std;int main(){ student a[N]; ifstream infile("1.txt",ios::in); if(!infile){ cerr<<"open error!"; exit(1); }
2017-02-28 20:56:32 333
原创 学习笔记 2017-2-28
单链表#include#include#define N 100using namespace std;struct student{int num;char name;struct student *next;};class Linklist{struct student first;//头结点 public:Linklist();Link
2017-02-28 16:20:51 247
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人