摘要: shell命令解释器查看当前系统下有哪些shell查看当前系统正在使用的shellecho $SHELLbash实用命令ctrl+a //命令的最开头ctrl+e //命令的最末尾ctrl+p //前一个命令ctrl+n //后一个命令ctrl+b //光标向前移动ctrl+f //光标向后移动cr 阅读全文
posted @ 2014-09-03 22:48 我爱背单词 阅读(139) 评论(0) 推荐(0) 编辑
摘要: 实现代码如下:#include <stdio.h>#include <stdlib.h>#include <string.h>typedef struct{ char * key; //单词的指针 int ntrans; //解释的个数 char ** trans; //解释的指针数组}WORD, 阅读全文
posted @ 2014-09-03 22:40 我爱背单词 阅读(147) 评论(0) 推荐(0) 编辑
摘要: 第一阶段:设计结构体struct WORD{ char *key; //先测试单词长度,然后再malloc int ntrans; //记录单词解释个数 char **trans; //指针数组,每个指针都指向一个解释};malloc:11万个结构体数组 每个单词的内容 根据ntrans的个数--> 阅读全文
posted @ 2014-09-03 22:31 我爱背单词 阅读(152) 评论(0) 推荐(0) 编辑
摘要: 冒泡排序: #include <stdio.h>#include <stdlib.h>#include <time.h>#define N 100000#define M 100000void show_arr(int * a,int n){ int i; for(i = 0; i < n; i++ 阅读全文
posted @ 2014-09-03 22:21 我爱背单词 阅读(132) 评论(0) 推荐(0) 编辑
摘要: fprintf() 、 sprintf、 snprintf :int fprintf(FILE *stream, const char *format, ...);int sprintf(char *str, const char *format, ...); int snprintf(char * 阅读全文
posted @ 2014-09-02 21:45 我爱背单词 阅读(368) 评论(0) 推荐(0) 编辑
摘要: fopen函数mode模式:w+不是追加写 是多了一个读权限文件指针+1没有意义拷贝一个文件: fgets fputs (fgetc同理)int main(){ FILE *fp, *fpcp; fp = fopen("yesteday_once_more.txt", "r"); fpcp = fo 阅读全文
posted @ 2014-09-02 21:34 我爱背单词 阅读(202) 评论(0) 推荐(0) 编辑
摘要: 数组指针的含义:一个指针指向一个数组 ,这个指针+1就会加一个数组的长度。#include <stdio.h>void show( char(*s)[10], int n){ while(n--) printf("%s\n",s++);}int main(){ char s[3][10] = {"h 阅读全文
posted @ 2014-09-02 20:54 我爱背单词 阅读(167) 评论(0) 推荐(0) 编辑
摘要: 二级指针找出最大的字符 : #include <stdio.h>char maxchar(char * str, char** max){ char da = *str; //先让最大的执行第一个字符 *max = str; while (*str) { if (*str > da) { da = 阅读全文
posted @ 2014-09-02 20:37 我爱背单词 阅读(228) 评论(0) 推荐(0) 编辑
摘要: typedef : 给类型起一个新的名字int main(){ unsigned int a = 10;}可以用下面表示:typedef unsigned int u32_t;int main(){ u32_t a = 10;}与definde的区别:typedef char * N;#define 阅读全文
posted @ 2014-09-02 16:37 我爱背单词 阅读(189) 评论(0) 推荐(0) 编辑
摘要: 函数外定义的是全局变量 > 整个程序都可以访问到,不过不同文件需要extern 函数内定义的是局部变量局部变量也分块作用域 :int a = 2;int main(){ int a = 5; { int a = 10; } }同一个函数内,子函数也可以访问到内部的变量#include <stdio. 阅读全文
posted @ 2014-09-02 16:25 我爱背单词 阅读(185) 评论(0) 推荐(0) 编辑