摘要:typedef enum { FALSE = 0, TRUE = 1 }BOOL; #define N 10 BOOL bTest(void); int main() { BOOL r; while(1) { r = bTest(); printf("%d\n",r); } } BOOL bTest(void) ...
阅读全文
摘要:#include #include typedef enum { FALSE = 0, TRUE }BOOL; void calculator(void); int main(void) { char y = ' '; y = 'y'; while('y' == y) { printf("start calculator:...
阅读全文
摘要:stray \241 程序有非法字符,如空格,引号等,一般因为从别的地方粘贴导致这个错误。
阅读全文
摘要:_____main函数含有 两个参数 ,argc ,argv[]这两个参数用以指示命令行输入的参数信息。argc 的值是输入的参数的数量。argv是一个数组,每个数组元素指向一个string字符串类型的数据的地址,也就是存放每一个输入参数的地址。argv就是 char ** 类型。void file...
阅读全文
摘要:优先级1,[], (), ., -> 从左到右2,-,~,++,--,*,&,!,(类型),sizeof() 从右到左 . 单目运算符。3,/, *, % 双目运算符4, +, -5, > 移位6, >, >=,|=......所有赋值运算符. 从右到左15,,括号成员后单目算术后面是...
阅读全文
摘要:episode2//it is very interesting,an excellect teacher, I love it1,why negative is indicated the way it is indicated2,how float is indicated3,type conv...
阅读全文
摘要:----数据类型长度C99标准并不规定具体数据类型的长度大小。计算机具有不同位数的处理器,16,32和更高位的64位处理器,在这些不同的平台上,同一种数据类型具有不同的长度。char,short,长度相同,分别为1和2个字节。int 在32和64位处理器上皆为4个字节,在16位上是2个字节。long...
阅读全文
摘要:memcpy#include //#include //uintptr_t is quoted.#include "string.h"/* * sizeof(word) MUST BE A POWER OF TWO * SO THAT wmask BELOW IS ALL ONES */...
阅读全文
摘要:_____谈谈排序算法交换排序——>冒泡排序-->快速排序选择排序——>简单选择排序——>堆排序插入排序——>直接插入排序——>希尔排序_____排序算法对比名称稳定性时间复杂度空间复杂度描述数据对象为链表平均最坏冒泡排序YO(n^2)O(1)无序区,有序区。 选择排序 O(n^2)O(1)有序区,...
阅读全文
摘要:直观的视频http://www.cnblogs.com/wangfupeng1988/archive/2011/12/26/2302216.html1,冒泡排序——冒泡,每一次最大的值升到最后面,像水泡升到了水面,冒出来了,不再位于水里,不再需要比较,它已经确定了,独立了。每次从最前面开始比较相邻的...
阅读全文
摘要:C 日记目录C basics ................writing Numerationstorage , structor space assigningpointer, arrayothers___________________________________-c coding1....
阅读全文
摘要:Most string operations can use the same logic forUnicodeand forWindows code pages. The only difference is that the basic unit of operation is a 16-bit character (also known as a wide character) for Unicode and an 8-bit character for Windows code pages. The Windows header files provide several type d
阅读全文
摘要:http://msdn.microsoft.com/en-us/library/vstudio/56e442dc.aspx%[flags] [width] [.precision] [{h|l|ll|w|I|I32|I64}]typewidthOptional decimal number that specifies the minimum number of characters that are output.If the number of characters in the output value is less than the specified width, blanks a
阅读全文
摘要:__________输出字符串char str[]="two"; //orchar *str = "two";puts(str); //orprintf("%s",str);__wrong:-------char **str = "two";printf("%s",*str);_______...
阅读全文
摘要:(1) getch()和getche()函数 这两个函数都是从键盘上读入一个字符。其调用格式为: getch(); getche(); 两者的区别是: getch()函数不将读入的字符回显在显示屏幕上, 而getche()函数却将读入的字符回显到显示屏幕上。 例1: #include<stdio.h> main() { char c, ch; c=getch(); /*从键盘上读入一个字符不回显送给字符变量c*/ putchar(c); /*输出该字符*/ ch=getche(); /*从键盘上带回显的读入一个字符送给字符变量ch*/ putchar(ch); } 利用回显和不回显
阅读全文
摘要:所有的ASCII码都可以用“\”加数字(一般是8进制数字)来表示。而C中定义了一些字母前加"\"来表示常见的那些不能显示的ASCII字符,如\0,\t,\n等,就称为转义字符,因为后面的字符,都不是它本来的ASCII字符意思了。 转义字符 意义 ASCII码值(十进制) \a 响铃(BEL) 007 \b 退格(BS) 008 \f 换页(FF) 012 \n 换行(LF) 010 \r 回车(CR) 013 \t 水平制表(HT) 009 \v 垂直制表(VT) 011 \\ 反斜杠 092 \? 问号字符 063 \' 单引号字符 039 \"...
阅读全文
摘要:open fileifstream in;in.open("input.txt"); //parameter is uchar*! just correspond with the main parameter, argv[1].ifstream& openFile(ifstream& inf, const char* pN){ inf.close(); //close flow inf.clear(); //clear any existing error //combine inf and file, open file. inf.op...
阅读全文
摘要:容器的综合应用:文本查询程序该程序将读取用户指定的任意文本文件,然后允许用户从该文件中查找单词。查询的结果是该单词出现的次数,并列出每次出现的行。如果某单词在同一行多次出现,程序将只显示该行一次。行号按升序显示。设计程序的一个良好习惯是首先将程序所涉及的操作列出来。明确需要提供的操作有助于建立需要的...
阅读全文