字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1
上传时间: 2013-12-09
上传用户:gonuiln
字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1
上传时间: 2015-07-06
上传用户:tianjinfan
字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能2
上传时间: 2014-01-15
上传用户:sevenbestfei
#include<stdio.h> #include<string.h> #include<limits.h> #include<unistd.h> #include<sys/types.h> #define PROMPT_STRING "[myshell]$" #define QUIT_STRING "exit\n" static char inbuf[MAX_CANON] char * g_ptr char * g_lim extern void yylex() int main (void){ for( ){ if(fputs(PROMPT_STRING,stdout)==EOF) continue if(fgets(inbuf,MAX_CANON,stdin)==NULL) continue if(strcmp(inbuf,QUIT_STRING)==0) break g_ptr = inbuf g_lim = inbuf + strlen(inbuf) yylex() } return 0 }
上传时间: 2016-12-31
上传用户:colinal