Location:
Search - fgets
Search list
Description: fgets() sample~
how to use readRestOfLine-fgets() sample~ how to use readRestOfLine
Platform: |
Size: 1627 |
Author: 严密 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1-string literacy fgets and fputs function, reading the string functions fgets of functionality 1
Platform: |
Size: 1228 |
Author: ghost2008 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1-string literacy fgets and fputs function, reading the string functions fgets of functionality 1
Platform: |
Size: 1039 |
Author: ghost2008 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能2-string literacy fgets and fputs function, reading the string functions fgets of functionality 2
Platform: |
Size: 989 |
Author: ghost2008 |
Hits:
Description: fgets() sample~
how to use readRestOfLine-fgets() sample~ how to use readRestOfLine
Platform: |
Size: 1024 |
Author: 严密 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1-string literacy fgets and fputs function, reading the string functions fgets of functionality 1
Platform: |
Size: 1024 |
Author: ghost2008 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能1-string literacy fgets and fputs function, reading the string functions fgets of functionality 1
Platform: |
Size: 1024 |
Author: ghost2008 |
Hits:
Description: 字符串读写函数fgets和fputs ,读字符串函数fgets函数的功能2-string literacy fgets and fputs function, reading the string functions fgets of functionality 2
Platform: |
Size: 1024 |
Author: ghost2008 |
Hits:
Description: token,字符数组,长度为32,存放识别出来的单词符号。
tmp,字符数组,长度为256,可以缓存用户输入的字符串。
char *fgets(char *string, int n, *stdin):*string输入数据的首地址, n 一次读入数据块的长度, stream文件指针.
Void getbc() //检查ch中的字符是否为空白字符,如是则调用getch(),直到ch中读入一个非空白字符为止.
fgets() //从流中读取一字符串
Void getch() //读字符函数,从输入缓冲区读入写一个字符放在ch中,并指向下一个字符。
int stricmp(const char *s1,const char *s2) 比较字符串s1与s2的大小,并返回s1-s2.
int atoi(char *nptr) 将字符串nptr转换成整型数, 并返回这个数,错误返回0.
int reserve() //对token中的字符串查关键字表,若是则返回关键字,否则返回15.-err
Platform: |
Size: 1024 |
Author: 乐正清 |
Hits:
Description: #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
}
-# Include <stdio.h># Include <string.h># Include <limits.h># Include <unistd.h># Include <sys/types.h># Define PROMPT_STRING [myshell] $ # define QUIT_STRING exit 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)
Platform: |
Size: 32768 |
Author: 李明 |
Hits:
Description: 1.编写一个文件复制的C语言程序:
分别使用文件的系统调用read(fd, buf, nbytes), write(fd, buf, nbytes)和文件的库函数fread(buf, size, nitems, fp), fwrite(buf, size, nitems, fp),编写一个文件的复制程序。
当上述函数中nbytes, size和nitems都取值为1时(即一次读写一个字节),比较这两种程序的执行效率。当nbytes取1024字节,size取1024字节,且nitems取1时(即一次读写1024字节),再次比较这两种程序的执行效率。
2.分别使用fscanf和fprintf,fgetc和fputc,fgets和fputs(仅限于行结构的文本文件),实现上述的文件复制程序。你还可用其他的方法实现文件的复制功能吗?
3.编写一个父子进程之间用无名管道进行数据传送的C程序。父进程逐一读出一个文件的内容,并通过管道发送给子进程。子进程从管道中读出信息,再将其写入一个新的文件。程序结束后,对原文件和新文件的内容进行比较。
4.在两个用户的独立程序之间,使用有名管道,重新编写一个C程序,实现题3的功能。
-pipeline
Platform: |
Size: 35840 |
Author: yiyuzhiming |
Hits:
Description: gets,fgets非常好的 源码-It s a gets and fgets programming.
Platform: |
Size: 4096 |
Author: 认真的雪 |
Hits:
Description: Utility routines - fgets string for linux.
-Utility routines - fgets string for linux.
Platform: |
Size: 1024 |
Author: runsaogang |
Hits:
Description: 程序运行时,先从键盘输入一个文本文件的文件名(约定:字符数≤127字节,可含路径)和一个字符串(约定:字符数≤20字节,其中不含空格、TAB等,后面称之为Str),再在屏幕上显示该文件的内容。要求显示完内容后,在屏幕上输出文件的行数(行之间以’\n’为分隔、每行的长度不定但均≤200个字节)、字符串Str在文件中第1次出现的行号和最后一次出现的行号(查找时不区分大小写、不跨行查找,若未找到,则行号显示为-1)。
注意,程序中不能使用库函数fgets或使用同名的变量、函数、单词,行的编号从1开始计。
-Program is running, start with the keyboard input a text file name (convention: ≤ 127 byte characters, can contain the path) and a string (convention: the number of characters ≤ 20 bytes, which does not contain spaces, TAB, etc., hereinafter, referred Str), and then displayed on the screen contents of the file. Required to display the content, it output file on the screen the number of lines (lines between \ n as a separator, but indefinite length of each line were ≤ 200 bytes), the string Str 1st in the document appear the line number and line number of the last occurrence (search is not case sensitive, does not cross to find, if not found, the line number is displayed as-1).
Note that the program can not use the library function fgets or use the same name as variables, functions, word, line numbers starting at 1 meter.
Click here to download the program runs test file Test.txt. Programming Available
Platform: |
Size: 243712 |
Author: 肖硕 |
Hits:
Description: 可掌握fgets函数的用法。可将输入的键值放入一个数组内。-Can grasp the fgets function usage. Can be input into an array of keys inside.
Platform: |
Size: 1024 |
Author: 赵敏捷 |
Hits:
Description: Reads one line a-la fgets for Embedded Linux.
Platform: |
Size: 4096 |
Author: xingmaoyue |
Hits:
Description: 比较了C中的gets和fgets函数的用法不同,个人看着C和指针来的,可能理解会有偏颇,有不同观点的tx欢迎指正。-Compares in C gets and usage of the fgets function is different, people look at C and pointer, could have understanding bias, there are different views of tx welcome to point out mistakes.
Platform: |
Size: 1024 |
Author: 大鹏 |
Hits:
Description: fgets(),fputs()的用法,包含fgets()和fputs()的源码-the usage of fgets() and fputs()
Platform: |
Size: 1024 |
Author: 傅 |
Hits:
Description: THIS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T The copyright notice above does not evidence any actual or intended publication of such source code.
-THIS IS UNPUBLISHED PROPRIETARY SOURCE CODE OF AT&T The copyright notice above does not evidence any actual or intended publication of such source code.
Platform: |
Size: 4096 |
Author: gerbkna |
Hits: