- 博客(9)
- 资源 (1)
- 收藏
- 关注
原创 有关指针,地址和数组名等等。。
//发现的一些以前没有注意到的现象。。。。 #includeusing namespace std;void ref(char* (&ch)[3]){ cout cout cout}void argu(char* ch[]){ cout cout cout}int main(int argc,char* argv[]){ char* ch[3]; ch[0]="abc"; cout r
2009-08-13 21:31:00 336
原创 哈希表练习
#include#include#include#includetypedef unsigned __int64 Uint;using namespace std;struct Hash_elem{ //hash_table的元素 Uint hash_key; int hash_value;};struct Hash_table{ Hash_elem *table; in
2009-08-13 06:30:00 806
原创 《数据结构》中的哈希表实现的例子(C语言)
#用的是开放定址法处理冲突,线性探测再散列确定增量 #include#include#include#include#include #include#include #define TRUE 1#define FALSE 0#define OK 1#define ERROR 0#define SUCCESS 1#define UNSUCCESS 0#define DUPLICATE -1
2009-08-12 09:25:00 6069 2
原创 TC++PL Chapter 6 读书笔记
Chapter 6表达式和语句1.一个桌面计算器,允许用户自己输入语句的,类似一个小编译器写得蛮优雅。。。完整代码在这里2.有关命令行参数int main(int argc,char* argv[]){}程序的名字会传进来一个简单的测试程序,顺便巩固一下数组和指针知识 #includeusing namespace std;int main(int
2009-08-12 00:07:00 571
原创 TC++PL Chapter 6 完整的程序
//第六章的完整程序#include#include#include using namespace std;enum Token_value{ NAME,NUMBER,END, PLUS=+,MINUS=-,MUL=*,DIV=/, PRINT=;,ASSIGN==,LP=(,RP=) };Token_value curr_tok=PRINT;
2009-08-11 10:20:00 552
原创 字数统计-简单哈希表
读入二进制文本文件,统计并做一些计算 #include #include #include using namespace std;int cbtoi(char* ch) //哈希函数,将输入的8位二进制数的char[]转换成十进制数{ int v=0; for(int i=0;i if(ch[i]==1) v+=(1 return v;}int main(){if
2009-08-11 08:36:00 596
原创 TC++PL Chapter 4 读书笔记
TYPES AND DECLARATIONS类型与声明1.C++有一组基础类型,对应于计算机里的一些常见的基本存储单元和一些利用这些存储单元保存数据的基本方法Boolean,character,integer 统称为整形整形和float point(浮点型)统称为算术类型class和enum被称为用户定义类型,其他的叫做内部类型2.BOOLeanbool b=a
2009-08-06 09:26:00 749
原创 TC++PL Chapter 3 读书笔记
A Tour of the Standard Library本章中主要讲述了标准库中的一些基本应用从Hello World!程序开始,要使用标准库需要#include 和 namespace需要指出的是,在现在大多数的vc++版本中,形如#include 这种写法的时候需要使用作用域标识符 std:: 或者using namespace std 而#include
2009-08-05 17:27:00 425
原创 TC++PL Chapter 2 读书笔记
a tour of c++what is c++bj本人给出的解释是--a better c--support data abstraciton--support oop--support gp/*以往的编程范式*/数据抽象是为了让用户定义类型像内部类型一样定义和使用Decide which types you want;provide a full set
2009-08-05 16:08:00 548
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人