quiz 2 总结
1. assert
#include <assert.h> assert( int expression );
先计算表达式 expression ,如果其值为假(即为0),那么它先向stderr打印一条出错信息,然后终止程序运行
2. strcat()
1 #include <stdio.h> 2 #include <string.h> 3 4 int main () 5 { 6 char src[50], dest[50]; 7 8 strcpy(src, "This is source"); 9 strcpy(dest, "This is destination"); 10 11 strcat(dest, src); 12 13 printf("最终的目标字符串: |%s|", dest); 14 15 return(0); 16 }
最终的目标字符串: |This is destinationThis is source|