C语言
-
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 s...
-
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 ( fp...
-
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 , ...) { i...
-
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, 2...
-
C库函数raise()-C语言实例教程|
C库函数 raise() #include signal.h #include stdio.h #include stdlib.h void signal_catchfunc ( int ); int main () { int ret ; ret = signal ( SIGINT , signal_catchfunc ); if ( ret =...
-
C库函数longjmp()-C语言实例教程|
C库函数 longjmp() #include stdio.h #include stdlib.h #include setjmp.h int main () { int val ; jmp_buf env_buffer ; /* save calling environment for longjmp */ val = setjmp ( env_...
-
C库宏setjmp()-C语言实例教程|
C库宏 setjmp() #include stdio.h #include stdlib.h #include setjmp.h int main () { int val ; jmp_buf env_buffer ; /* save calling environment for longjmp */ val = setjmp ( env_buff...
-
C库函数floor()-C语言实例教程|
C库函数 floor() #include stdio.h #include math.h int main () { float val1 , val2 , val3 , val4 ; val1 = 1.6 ; val2 = 1.2 ; val3 = 2.8 ; val4 = 2.3 ; printf ( Value1 = %.1lf , flo...
-
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 absolute...
-
C库函数ceil()-C语言实例教程|
C库函数 ceil() #include stdio.h #include math.h int main () { float val1 , val2 , val3 , val4 ; val1 = 1.6 ; val2 = 1.2 ; val3 = 2.8 ; val4 = 2.3 ; printf ( value1 = %.1lf , ceil...
-
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 ( 0 ...
-
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 , int...
-
C库函数log10()-C语言实例教程|
C库函数 log10() #include stdio.h #include math.h int main () { double x , ret ; x = 10000 ; /* finding value of log1010000 */ ret = log10 ( x ); printf ( log10(%lf) = %lf , x , r...
-
C库函数log()-C语言实例教程|
C库函数 log() #include stdio.h #include math.h int main () { double x , ret ; x = 2.7 ; /* finding log(2.7) */ ret = log ( x ); printf ( log(%lf) = %lf , x , ret ); return ( 0 );...
-
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 ); return ...
-
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库函数exp()-C语言实例教程|
C库函数 exp() #include stdio.h #include math.h int main () { double x = 0 ; printf ( The exponential value of %lf is %lf , x , exp ( x )); printf ( The exponential value of %lf i...