C语言
-
C语言打印输出浮点类型-C语言基础教程实例源码|
C语言打印输出浮点类型 /* showf_pt.c -- displays float value in two ways */ #include stdio.h int main ( void ) { float aboat = 32000.0 ; double abet = 2.14e9 ; long double ...
-
C库函数wcstombs()-C语言实例教程|
C库函数 wcstombs() #include stdio.h #include stdlib.h #define BUFFER_SIZE 50 int main () { size_t ret ; char * MB = ( char * ) malloc ( BUFFER_SIZE ); wchar_t * WC = L https://ww...
-
C语言可移植整数类型名-C语言基础教程实例源码|
C语言可移植整数类型名 /* altnames.c -- portable names for integer types */ #include stdio.h #include inttypes.h // supports portable types int main ( void ) { int32_t me32...
-
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_CU...
-
C语言字符类型-C语言基础教程实例源码|
C语言字符类型 /* charcode.c-displays code number for a character */ #include stdio.h int main ( void ) { char ch ; printf ( Please enter a character. ); scanf ( %c , ch ); /* ...
-
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 * p...
-
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 * pwc ...
-
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 ) time ...
-
C库函数rand()-C语言实例教程|
C库函数 rand() #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 ) time (...
-
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 ( Remainder ...
-
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 of ...
-
C语言格式化输出整型-C语言基础教程实例源码|
C语言格式化输出整型 /* print2.c-more printf() properties */ #include stdio.h int main ( void ) { unsigned int un = 3000000000 ; /* system with 32-bit int */ short end = 200...
-
C语言整数溢出-C语言基础教程实例源码|
C语言整数溢出 /* toobig.c-exceeds maximum int size on our system */ #include stdio.h int main ( void ) { int i = 2147483647 ; unsigned int j = 4294967295 ; printf ( %d %d %d ,...
-
C语言打印八进制和十六机制格式-C语言基础教程实例源码|
C语言打印八进制和十六机制格式 /* bases.c--prints 100 in decimal, octal, and hex */ #include stdio.h int main ( void ) { int x = 100 ; printf ( dec = %d; octal = %o; he...
-
C语言打印int值-C语言基础教程实例源码|
C语言打印int值 /* print1.c-displays some properties of printf() */ #include stdio.h int main ( void ) { int ten = 10 ; int two = 2 ; printf ( Doing it right: ); printf ( %d min...
-
C实例程序-C语言基础教程实例源码|
C示例程序 /* platinum.c -- your weight in platinum */ #include stdio.h int main ( void ) { float weight ; /* user weight */ float value ; /* platinum equivalent */ printf ( Are ...
-
C语言语义错误-C语言基础教程实例源码|
C语言语义错误 /* stillbad.c -- a program with its syntax errors fixed */ #include stdio.h int main ( void ) { int n , n2 , n3 ; /* this program has a semantic error */ n = 5 ;...
-
调试C程序-C语言基础教程实例源码|
调试C程序 /* nogood.c -- a program with errors */ #include stdio.h int main ( void ) ( int n , int n2 , int n3 ; /* this program has several errors n = 5; n2 = n * n; n3 = n2 * ...
-
C语言函数-C语言基础教程实例源码|
C语言函数 //* two_func.c -- a program using two functions in one file */ #include stdio.h void butler ( void ); /* ANSI/ISO C function prototyping */ int main ( void ) { printf ...
-
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 ( Remainde...