C/C++
文章平均质量分 76
zjulbj
这个作者很懒,什么都没留下…
展开
-
一个c/c++程序中的内存分配
全局/静态数据区:存储全局变量,和静态变量static声明的变量 常量存储区:存储常量,如char *s="abcde"; 或者 const int i =10;代码区:这个不说了。代码放的地儿 栈:临时变量,参数等,有大小限制,vc6/7: 1M 堆: 用户自己维护的空间,内存使用需要自己申请,自己释放。大小基本不限(4G) example: #i转载 2013-03-29 20:30:54 · 477 阅读 · 0 评论 -
c++队列类的简单实现
同样是一个小作业,只做了一部分,有待完善 #ifndef QUEUE_H #define QUEUE_H /////////////// #include //声明一个Queue模板类 template class Queue; //定义一个节点类 template class qItem { friend class Queue; qItem(const T &t):item原创 2013-03-29 21:56:35 · 1341 阅读 · 0 评论 -
Project 3: Sort Poems
Project 3: Sort Poems Harry once found an interesting ancient poem written on a long strip of paper. He decided to save this piece of art into his computer by scanning the paper segment by segment.原创 2013-03-29 23:44:08 · 661 阅读 · 0 评论 -
c++写的一个简单的string类
这是刚开始学c++时候写的一个string类,有些细节还值得推敲,一直没时间重写写过,放在这以后再改改#ifndef _MYSTRING_H #define _MYSTRING_H #include #include #include #include namespace mstr { class mystring { public: typedef unsigned int size_t原创 2013-03-29 20:40:02 · 743 阅读 · 0 评论