C语言
-
C库函数-memcmp()-C语言实例教程|
C库函数 - memcmp() #include stdio.h #include string.h int main () { char str1 [ 15 ]; char str2 [ 15 ]; int ret ; memcpy ( str1 , abcdef , 6 ); memcpy ( str2 , ABCDEF , 6 ); ret ...
-
C库函数-memchr()-C语言实例教程|
C库函数 - memchr() #include stdio.h #include string.h int main () { const char str [] = http://www.codingdict.com ; const char ch = . ; char * ret ; ret = memchr ( str , ch , str...
-
C库函数-wctomb()-C语言实例教程|
C库函数 - wctomb() #include stdio.h #include stdlib.h int main () { int i ; wchar_t wc = L a ; char * pmbnull = NULL ; char * pmb = ( char * ) malloc ( sizeof ( char )); printf (...
-
C库函数-mbtowc()-C语言实例教程|
C库函数 - mbtowc() #include stdio.h #include stdlib.h #include string.h int main () { char * str = This is codingdict.com ; wchar_t mb [ 100 ]; int len ; len = mblen ( NULL , MB_...
-
C库函数-mbstowcs()-C语言实例教程|
C库函数 - mbstowcs() #include stdio.h #include stdlib.h #include string.h int main () { int len ; char * pmbnull = NULL ; char * pmb = ( char * ) malloc ( MB_CUR_MAX ); wchar_t *...
-
C库函数-mblen()-C语言实例教程|
C库函数 - mblen() #include stdio.h #include stdlib.h #include string.h int main () { int len ; char * pmbnull = NULL ; char * pmb = ( char * ) malloc ( MB_CUR_MAX ); wchar_t * pw...
-
C库函数-srand()-C语言实例教程|
C库函数 - srand() #include stdio.h #include stdlib.h #include time.h int main () { int i , n ; time_t t ; n = 5 ; /* Intializes random number generator */ srand (( unsigned ) tim...
-
C库函数-rand()-C语言实例教程|
C库函数 - rand() #include stdio.h #include stdlib.h int main () { int i , n ; time_t t ; n = 5 ; /* Intializes random number generator */ srand (( unsigned ) time ( t )); /* Prin...
-
C库函数-ldiv()-C语言实例教程|
C库函数 - ldiv() #include stdio.h #include stdlib.h int main () { ldiv_t output ; output = ldiv ( 100000L , 30000L ); printf ( Quotient = %ld , output . quot ); printf ( Remainde...
-
C库函数-labs()-C语言实例教程|
C库函数 - labs() #include stdio.h #include stdlib.h int main () { long int a , b ; a = labs ( 65987L ); printf ( Value of a = %ld , a ); b = labs ( - 1005090L ); printf ( Value o...
-
C库函数-div()-C语言实例教程|
C库函数 - div() #include stdio.h #include stdlib.h int main () { div_t output ; output = div ( 27 , 4 ); printf ( Quotient part of (27/ 4) = %d , output . quot ); printf ( Remain...
-
C库函数-abs()-C语言实例教程|
C库函数 - abs() #include stdio.h #include stdlib.h int main () { int a , b ; a = abs ( 5 ); printf ( value of a = %d , a ); b = abs ( - 10 ); printf ( value of b = %d , b ); retu...
-
C库函数-qsort()-C语言实例教程|
C库函数 - qsort() #include stdio.h #include stdlib.h int values [] = { 88 , 56 , 100 , 2 , 25 }; int cmpfunc ( const void * a , const void * b ) { return ( * ( int * ) a - * ( in...
-
C库函数-bsearch()-C语言实例教程|
C库函数 - bsearch() #include stdio.h #include stdlib.h int cmpfunc ( const void * a , const void * b ) { return ( * ( int * ) a - * ( int * ) b ); } int values [] = { 5 , 20 , 29...
-
C库函数-getenv()-C语言实例教程|
C库函数 - getenv() #include stdio.h #include stdlib.h int main () { printf ( PATH : %s , getenv ( PATH )); printf ( HOME : %s , getenv ( HOME )); printf ( ROOT : %s , getenv ( RO...
-
C库函数-exit()-C语言实例教程|
C库函数 - exit() #include stdio.h #include stdlib.h int main () { printf ( Start of the program.... ); printf ( Exiting the program.... ); exit ( 0 ); printf ( End of the program...
-
C库函数-atexit()-C语言实例教程|
C库函数 - atexit() #include stdio.h #include stdlib.h void functionA () { printf ( This is functionA ); } int main () { /* register the termination function */ atexit ( functionA...
-
C库函数-abort()-C语言实例教程|
C库函数 - abort() #include stdio.h #include stdlib.h int main () { FILE * fp ; printf ( Going to open nofile.txt ); fp = fopen ( nofile.txt , r ); if ( fp == NULL ) { printf ( Go...
-
C库函数-realloc()-C语言实例教程|
C库函数 - realloc() #include stdio.h #include stdlib.h int main () { char * str ; /* Initial memory allocation */ str = ( char * ) malloc ( 15 ); strcpy ( str , codingdict ); pri...
-
C库函数-free()-C语言实例教程|
C库函数 - free() #include stdio.h #include stdlib.h #include string.h int main () { char * str ; /* Initial memory allocation */ str = ( char * ) malloc ( 15 ); strcpy ( str , co...