C语言
-
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 :...
-
C库函数-clearerr()-C语言实例教程|
C库函数 - clearerr() #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...
-
C库宏-offsetof()-C语言实例教程|
C库宏 - offsetof() #include stddef.h #include stdio.h struct address { char name [ 50 ]; char street [ 50 ]; int phone ; }; int main () { printf ( name offset = %d byte in address...
-
C库宏-NULL()-C语言实例教程|
C库宏 - NULL() #include stddef.h #include stdio.h int main () { FILE * fp ; fp = fopen ( file.txt , r ); if ( fp != NULL ) { printf ( Opend file file.txt successfully ); fclose ( ...
-
C库宏-va_end()-C语言实例教程|
C库宏 - va_end() #include stdarg.h #include stdio.h int mul ( int , ...); int main () { printf ( 15 * 12 = %d , mul ( 2 , 15 , 12 ) ); return 0 ; } int mul ( int num_args , ...) {...
-
C库宏-va_arg()-C语言实例教程|
C库宏 - va_arg() #include stdarg.h #include stdio.h int sum ( int , ...); int main () { printf ( Sum of 15 and 56 = %d , sum ( 2 , 15 , 56 ) ); return 0 ; } int sum ( int num_args...
-
C库宏-va_start()-C语言实例教程|
C库宏 - va_start() #include stdarg.h #include stdio.h int sum ( int , ...); int main ( void ) { printf ( Sum of 10, 20 and 30 = %d , sum ( 3 , 10 , 20 , 30 ) ); printf ( Sum of 4,...
-
C库函数-fabs()-C语言实例教程|
C库函数 - fabs() #include stdio.h #include math.h int main () { int a , b ; a = 1234 ; b = - 344 ; printf ( The absolute value of %d is %lf , a , fabs ( a )); printf ( The absolu...
-
C库函数-sqrt()-C语言实例教程|
C库函数 - sqrt() #include stdio.h #include math.h int main () { printf ( Square root of %lf is %lf , 4.0 , sqrt ( 4.0 ) ); printf ( Square root of %lf is %lf , 5.0 , sqrt ( 5.0 )...
-
C库函数-pow()-C语言实例教程|
C库函数 - pow() #include stdio.h #include math.h int main () { printf ( Value 8.0 ^ 3 = %lf , pow ( 8.0 , 3 )); printf ( Value 3.05 ^ 1.98 = %lf , pow ( 3.05 , 1.98 )); return ( ...
-
C库函数-modf()-C语言实例教程|
C库函数 - modf() #include stdio.h #include math.h int main () { double x , fractpart , intpart ; x = 8.123456 ; fractpart = modf ( x , intpart ); printf ( Integral part = %lf , i...
-
C库函数-ldexp()-C语言实例教程|
C库函数 - ldexp() #include stdio.h #include math.h int main () { double x , ret ; int n ; x = 0.65 ; n = 3 ; ret = ldexp ( x , n ); printf ( %f * 2^%d = %f , x , n , ret ); retur...
-
C库函数-frexp()-C语言实例教程|
C库函数 - frexp() #include stdio.h #include math.h int main () { double x = 1024 , fraction ; int e ; fraction = frexp ( x , e ); printf ( x = %.2lf = %.2lf * 2^%d , x , fraction...
-
C库函数-setlocale()-C语言实例教程|
C库函数 - setlocale() #include locale.h #include stdio.h #include time.h int main () { time_t currtime ; struct tm * timer ; char buffer [ 80 ]; time ( currtime ); timer = localt...
-
C库-<limits.h>-C语言实例教程|
C库 - limits.h #include stdio.h #include limits.h int main () { printf ( The number of bits in a byte %d , CHAR_BIT ); printf ( The minimum value of SIGNED CHAR = %d , SCHAR_MIN );...
-
C库-<float.h>-C语言实例教程|
C库 - float.h #include stdio.h #include float.h int main () { printf ( The maximum value of float = %.10e , FLT_MAX ); printf ( The minimum value of float = %.10e , FLT_MIN ); prin...
-
C库宏-errno-C语言实例教程|
C库宏 - errno #include stdio.h #include errno.h #include string.h extern int errno ; int main () { FILE * fp ; fp = fopen ( file.txt , r ); if ( fp == NULL ) { fprintf ( stderr , ...
-
C库函数-toupper()-C语言实例教程|
C库函数 - toupper() #include stdio.h #include ctype.h int main () { int i = 0 ; char c ; char str [] = Tutorials Point ; while ( str [ i ]) { putchar ( toupper ( str [ i ])); i +...
-
C库函数-tolower()-C语言实例教程|
C库函数 - tolower() #include stdio.h #include ctype.h int main () { int i = 0 ; char c ; char str [] = TUTORIALS POINT ; while ( str [ i ] ) { putchar ( tolower ( str [ i ])); i ...
-
C库函数-isxdigit()-C语言实例教程|
C库函数 - isxdigit() #include stdio.h #include ctype.h int main () { char var1 [] = tuts ; char var2 [] = 0xE ; if ( isxdigit ( var1 [ 0 ]) ) { printf ( var1 = |%s| is hexadecima...