C&C++
文章平均质量分 59
bibilzz
这个作者很懒,什么都没留下…
展开
-
fatal error C1010: unexpected end of file while looking for precompiled header directive
在编译VC++6.0是,出现fatal error C1010: unexpected end of file while looking for precompiled header directive 的错误. 解决方法: 1、如果发生错误的文件是由其他的C代码文件添加进入当前工程而引起的,则Alt+F7进入当前工程的 Settings,选择C/C++选项卡,从Category组合框中转载 2014-09-05 20:22:47 · 332 阅读 · 0 评论 -
栈的实现(C++语言)
LStach.h: #include "stdafx.h" #include using namespace std; typedef int ElemType; typedef struct Node { ElemType elem; struct Node* pNext; }NODE,* PNODE; class LStack { PNODE pBottom; PNODE p原创 2014-09-16 23:51:43 · 403 阅读 · 0 评论 -
数组实现线性表部分功能
// LinkList.cpp : Defines the entry point for the console application. // //#include "stdafx.h" #include #include using namespace std; #define LIST_INIT_SIZE 10 /* 线性表存储空间的初始分配量 */ #define LIST_原创 2014-09-16 23:45:35 · 303 阅读 · 0 评论 -
小算法:汉诺塔、冒泡法
汉诺塔: // Hanoi.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include //#include //#include using namespace std; const int LEN=20; long int count=0; void Mo原创 2014-09-16 23:55:19 · 555 阅读 · 0 评论 -
链表的实现(C++语言)
// LinkedList2.cpp : Defines the entry point for the console application. // #include "stdafx.h" #include #include typedef int ElemType; using namespace std; struct Node { ElemType elem; Nod原创 2014-09-16 23:47:26 · 380 阅读 · 0 评论 -
输入函数对比及输入带空格的字符串
1.第一种方法输入带空格的字符串,最简单的方法: char ch[100] gets(ch); cout 2.第二种方法输入带空格的字符串 #include using namespace std; int main() { char c; while(c=cin.get()) //接受单个字符(包括空格) { cout.put(c);转载 2014-08-24 00:34:41 · 1166 阅读 · 0 评论 -
ofstream/ifstream 文本/二进制 方式 读入/写出 数据方法
文件 I/O 在C++中比烤蛋糕简单多了。 在这篇文章里,我会详细解释ASCII和二进制文件的输入输出的每个细节,值得注意的是,所有这些都是用C++完成的。 一、ASCII 输出 为了使用下面的方法, 你必须包含头文件(译者注:在标准C++中,已经使用取代,所有的C++标准头文件都是无后缀的。)。这是 的一个扩展集, 提供有缓冲的文件输入输出操作. 事实上, 已经被包含了,转载 2014-08-24 11:30:25 · 496 阅读 · 0 评论 -
树的分类、存储、遍历
先序遍历[先访问根节点]原创 2014-09-17 23:33:12 · 476 阅读 · 0 评论 -
array 及 vector 的使用
撰写一个程序,从标准输入装置读取一串整数,并将读入的整数依次置入array及vector,然后遍历这两种容器,求取数值总和,将总和及平均值输出至标准输装置。原创 2014-08-24 10:32:42 · 528 阅读 · 0 评论 -
C++基本数据类型表示范围
类型标识符 类型说明 长度 (字节) 范围 备注 char 字符型 1 -128 ~ 127 -27 ~ (27 -1) unsigned char 无符字符型 1 0 ~ 255 0 ~ (28 -1) short int 短整型 2 -32768 ~ 32767 2-15 ~ (215 - 1) unsigned short int 无符短整型转载 2014-08-24 00:41:16 · 629 阅读 · 0 评论 -
[C语言]字符数组与字符串的使用详解
1、字符数组的定义与初始化 字符数组的初始化,最容易理解的方式就是逐个字符赋给数组中各元素。 char str[10]={ 'I',' ','a','m',' ',‘h','a','p','p','y'}; 即把10个字符分别赋给str[0]到str[9]10个元素 如果花括号中提供的字符个数大于数组长度,则按语法错误处理;若小于数组长度,则只将这些字符数组中前面那些元素,其余的元素自动定转载 2014-08-24 00:26:15 · 602 阅读 · 0 评论 -
循环队列的实现(C++语言)
// Circular_Queue.cpp : Defines the entry point for the console application. // //#include "stdafx.h" #include typedef int ElemType; using namespace std; const int SIZE=6; class Circular_Queue {原创 2014-09-16 23:50:53 · 449 阅读 · 0 评论