C语言
-
C库函数fmod()-C语言实例教程|
C库函数 fmod() #include stdio.h #include math.h int main () { float a , b ; int c ; a = 9.2 ; b = 3.7 ; c = 2 ; printf ( Remainder of %f / %d is %lf , a , c , fmod ( a , c )); pr...
-
C库函数perror()-C语言实例教程|
C库函数 perror() #include stdio.h int main () { FILE * fp ; /* first rename if there is any file */ rename ( file.txt , newfile.txt ); /* now lets try to open same file */ fp = f...
-
C库函数puts()-C语言实例教程|
C库函数 puts() #include stdio.h #include string.h int main () { char str1 [ 15 ]; char str2 [ 15 ]; strcpy ( str1 , codingdict ); strcpy ( str2 , compileonline ); puts ( str1 ); ...
-
C库函数putchar()-C语言实例教程|
C库函数 putchar() #include stdio.h int main () { char ch ; for ( ch = A ; ch = Z ; ch ++ ) { putchar ( ch ); } return ( 0 ); }...
-
C库函数sscanf()-C语言实例教程|
C库函数 sscanf() #include stdio.h #include stdlib.h #include string.h int main () { int day , year ; char weekday [ 20 ], month [ 20 ], dtm [ 100 ]; strcpy ( dtm , Saturday March...
-
C库函数fscanf()-C语言实例教程|
C库函数 fscanf() #include stdio.h #include stdlib.h int main () { char str1 [ 10 ], str2 [ 10 ], str3 [ 10 ]; int year ; FILE * fp ; fp = fopen ( file.txt , w+ ); fputs ( We are ...
-
C库函数vsprintf()-C语言实例教程|
C库函数 vsprintf() #include stdio.h #include stdarg.h char buffer [ 80 ]; int vspfunc ( char * format , ...) { va_list aptr ; int ret ; va_start ( aptr , format ); ret = vsprintf...
-
C库函数vprintf()-C语言实例教程|
C库函数 vprintf() #include stdio.h #include stdarg.h void WriteFrmtd ( char * format , ...) { va_list args ; va_start ( args , format ); vprintf ( format , args ); va_end ( args ...
-
C库函数sprintf()-C语言实例教程|
C库函数 sprintf() #include stdio.h #include math.h int main () { char str [ 80 ]; sprintf ( str , Value of Pi = %f , M_PI ); puts ( str ); return ( 0 ); }...
-
C库函数printf()-C语言实例教程|
C库函数 printf() #include stdio.h int main () { int ch ; for ( ch = 75 ; ch = 100 ; ch ++ ) { printf ( ASCII value = %d, Character = %c , ch , ch ); } return ( 0 ); }...
-
C库函数tmpnam()-C语言实例教程|
C库函数 tmpnam() #include stdio.h int main () { char buffer [ L_tmpnam ]; char * ptr ; tmpnam ( buffer ); printf ( Temporary name 1: %s , buffer ); ptr = tmpnam ( NULL ); printf ...
-
C库函数tmpfile()-C语言实例教程|
C库函数 tmpfile() #include stdio.h int main () { FILE * fp ; fp = tmpfile (); printf ( Temporary file created ); /* you can use tmp file here */ fclose ( fp ); return ( 0 ); }...
-
C库函数setvbuf()-C语言实例教程|
C库函数 setvbuf() #include stdio.h #include string.h #include unistd.h int main () { char buff [ 1024 ]; memset ( buff , � , sizeof ( buff )); fprintf ( stdout , Going to set f...
-
C库函数setbuf()-C语言实例教程|
C库函数 setbuf() #include stdio.h int main () { char buf [ BUFSIZ ]; setbuf ( stdout , buf ); puts ( This is codingdict ); fflush ( stdout ); return ( 0 ); }...
-
C库函数rewind()-C语言实例教程|
C库函数 rewind() #include stdio.h int main () { char str [] = This is codingdict.com ; FILE * fp ; int ch ; /* First lets write some content in the file */ fp = fopen ( file.txt ...
-
C库函数remove()-C语言实例教程|
C库函数 remove() #include stdio.h #include string.h int main () { int ret ; FILE * fp ; char filename [] = file.txt ; fp = fopen ( filename , w ); fprintf ( fp , %s , This is cod...
-
C库freopen()-C语言实例教程|
C库 freopen() #include stdio.h int main () { FILE * fp ; printf ( This text is redirected to stdout ); fp = freopen ( file.txt , w+ , stdout ); printf ( This text is redirected to ...
-
C库函数fread()-C语言实例教程|
C库函数 fread() #include stdio.h #include string.h int main () { FILE * fp ; char c [] = this is codingdict ; char buffer [ 100 ]; /* Open file for both reading and writing */ fp...
-
C库函数fflush()-C语言实例教程|
C库函数 fflush() #include stdio.h #include string.h #include unistd.h int main () { char buff [ 1024 ]; memset ( buff , � , sizeof ( buff )); fprintf ( stdout , Going to set fu...
-
C库函数ferror()-C语言实例教程|
C库函数 ferror() #include stdio.h int main () { FILE * fp ; char c ; fp = fopen ( file.txt , w ); c = fgetc ( fp ); if ( ferror ( fp ) ) { printf ( Error in reading from file : f...