随笔分类 - BLP note
摘要:fopen, fclose#include <stdio.h>FILE *fopen(const char *path, const char *mode);int fclose(FILE *fp);fread, fwrite#include <stdio.h>size_t fread(void *ptr, size_t size, size_t nmemb, FILE *stream);size_t fwrite(const void *ptr, size_t size, size_t nmemb, FILE *stream);fgetc, getc, getchar
阅读全文
摘要:读写与打开 1 #include <unistd.h> 2 3 ssize_t write(int fd, const void *buf, size_t count); 4 ssize_t read(int fd, void *buf, size_t count); 5 6 7 #include <sys/types.h> 8 #include <sys/stat.h> 9 #include <fcntl.h>10 11 int open(const char *pathname, int flags);12 int open(const ch
阅读全文
摘要:管道和重定向1 重定向输出>2 重定向输入<3 管道|变量1 用户变量2 环境变量3 参数变量 参数变量 说明 $0 shell脚本的名字 $$ shell脚本的进程号 $1, $2, ... 各个参数 $# 参数个数 $* 列出所有参数 $@ 列出所有参数(不受IFS改变) 条件测试命令test或[字符串比较 string1 = string2 string1 != string2 -n string 字符串不为空,则为真 -z st...
阅读全文
摘要:文本编辑器可以选择Vim和或者GNU Emacs1 http://www.vim.org/2 http://www.gnu.org/software/emacs/编译器GCC1 http://gcc.gnu.org/shell程序搜索到目录路径储存在shell变量PATH中1 $ echo $PATH2 /usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin:/usr/games头文件(-I指定搜索路径)1 /usr/include库文件(-L指定搜索路径,-l指定库文件)1 /lib和/usr/lib总结:掌握以下命令1 gc
阅读全文
浙公网安备 33010602011771号