
操作系统C/C 源码
nuoline
关注NLP,ML,云计算,大数据,hadoop
微博:http://weibo.com/nuoline
个人博客网站:http://www.zhaizhouwei.cn/
展开
-
哈夫曼编译码C语言实现
注:转载请标明出处本博客 #include #include #include #include #define OK 1 #define ERROR 0 #define OVERFLOW -1 #define MAX_NUM 9999 #define MAX 60 typedef char **HuffmanCode; typedef struct { int weig原创 2013-02-25 18:34:12 · 2832 阅读 · 0 评论 -
C++文件打开
打开文件,如果文件不存在不新建 #include #include //exit() int main() { ifstream infile; infile.open("myfile.dat",ios::nocreate); if(infile.fail()) { cout << "the file are not successfully opened" exit(1); } cout<<原创 2013-02-25 18:38:27 · 734 阅读 · 0 评论 -
词法分析器
1 问题描述 对于如下文法所定义的PASCAL语言子集,试编写并上机调试一个词法分析程序: →PROGRAM ;. →BEGINEND →VAR:;| →, | →INTEGER →; | → | | WHILE语句> | | →:= →IFTHENELSE WHILE语句>→WHILEDO →BEGINEND →PROCEDURE; BEGINEND →()|原创 2013-02-25 18:33:50 · 875 阅读 · 0 评论 -
语法分析器C语言实现
#include"stdlib.h" #include"stdio.h" #include"string.h" #include typedef struct { char R; char r; int flag; }array; array F[30]; typedef struct { char E; char e; }charLode; type原创 2013-02-25 18:34:10 · 3599 阅读 · 0 评论 -
使用ifstream和getline读取文件内…
假设有一个叫 data.txt 的文件, 它包含以下内容: Fry: One Jillion dollars. [Everyone gasps.] Auctioneer: Sir, that's not a number. 数据读取, 测试 。 #include iostream> #include fstream> #include string> using namespac原创 2013-02-25 18:38:25 · 606 阅读 · 1 评论