C语言
-
C语言使用修饰符和标记实例-C语言基础教程实例源码|
C语言使用修饰符和标记实例 /* width.c -- field widths */ #include stdio.h #define PAGES 959 int main ( void ) { printf ( *%d* , PAGES ); printf ( *%2d* , PAGES ); printf ...
-
C库函数strcmp()-C语言实例教程|
C库函数 strcmp() #include stdio.h #include string.h int main () { char str1 [ 15 ]; char str2 [ 15 ]; int ret ; strcpy ( str1 , abcdef ); strcpy ( str2 , ABCDEF ); ret = strcmp (...
-
C语言printout函数实例-C语言基础教程实例源码|
C语言printout函数实例 /* printout.c -- uses conversion specifiers */ #include stdio.h #define PI 3.141593 int main ( void ) { int number = 7 ; float pies = 12.75 ; int cost = ...
-
C库函数strchr()-C语言实例教程|
C库函数 strchr() #include stdio.h #include string.h int main () { const char str [] = http://www.codingdict.com ; const char ch = . ; char * ret ; ret = strchr ( str , ch ); prin...
-
C语言limit.h实例-C语言基础教程实例源码|
05 C语言使用limit.h // defines.c -- uses defined constants from limit.h and float. #include stdio.h #include limits.h // integer limits #include float.h // floating-point limits...
-
C库函数strncat()-C语言实例教程|
C库函数 strncat() #include stdio.h #include string.h int main () { char src [ 50 ], dest [ 50 ]; strcpy ( src , This is source ); strcpy ( dest , This is destination ); strncat (...
-
C语言常量实例-C语言基础教程实例源码|
C语言常量实例 /* pizza.c -- uses defined constants in a pizza context */ #include stdio.h #define PI 3.14159 int main ( void ) { float area , circum , radius ; printf ( What i...
-
C库函数strcat()-C语言实例教程|
C库函数 strcat() #include stdio.h #include string.h int main () { char src [ 50 ], dest [ 50 ]; strcpy ( src , This is source ); strcpy ( dest , This is destination ); strcat ( d...
-
C库函数memset()-C语言实例教程|
C库函数 memset() #include stdio.h #include string.h int main () { char str [ 50 ]; strcpy ( str , This is string.h library function ); puts ( str ); memset ( str , $ , 7 ); puts ...
-
C库函数memmove()-C语言实例教程|
C库函数 memmove() #include stdio.h #include string.h int main () { char dest [] = oldstring ; const char src [] = newstring ; printf ( Before memmove dest = %s, src = %s , dest ,...
-
C库函数memcpy()-C语言实例教程|
C库函数 memcpy() #include stdio.h #include string.h int main () { const char src [ 50 ] = https://www.codingdict.com ; char dest [ 50 ]; printf ( Before memcpy dest = %s , dest )...
-
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语言strlen函数-C语言基础教程实例源码|
C语言strlen函数 /* praise2.c */ // try the %u or %lu specifiers if your implementation // does not recognize the %zd specifier #include stdio.h #include string.h /* provides str...
-
C语言字符串实例-C语言基础教程实例源码|
C语言字符串实例 /* praise1.c -- uses an assortment of strings */ #include stdio.h #define PRAISE You are an extraordinary being. int main ( void ) { char name [ 40 ]; printf ...
-
C语言转义实例-C语言基础教程实例源码|
12 C语言转义实例 /* escape.c -- uses escape characters */ #include stdio.h int main ( void ) { float salary ; printf ( Enter your desired monthly salary: ); /* 1 */ printf ( $...
-
C语言参数错误实例-C语言基础教程实例源码|
C语言参数错误实例 /* badcount.c -- incorrect argument counts */ #include stdio.h int main ( void ) { int n = 4 ; int m = 5 ; float f = 7.0f ; float g = 8.0f ; printf ( %d , ...
-
C语言整型大小-C语言基础教程实例源码|
10 C语言整型大小 //* typesize.c -- prints out type sizes */ #include stdio.h int main ( void ) { /* c99 provides a %zd specifier for sizes */ printf ( Type int has a size of %...
-
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 , strle...
-
C语言浮点数舍入错误-C语言基础教程实例源码|
09 C语言浮点数舍入错误 /* floaterr.c--demonstrates round-off error */ #include stdio.h int main ( void ) { float a , b ; b = 2.0e20 + 1.0 ; a = b - 2.0e20 ; printf ( %f , a...
-
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...