C程序设和计.ppt

C程序设和计

* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 小结: 1、字符串变量和字符串数组 #includestring string str1=cdfcdf, str2=abc; 或cinstr1str2; 1) str1=str1+str2; coutstr1; 2) str1=str2; coutstr1; 3) cout (str1str2); 4) int i; i=sizeof(str1); couti; 等价 coutsizeof(str1); //16B 5) string str[2]; str[0]= abc; str[1]= 123; * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * 例5.10 有3个字符串, 要求找出其中最大者。 要求用函数调用。 程序如下: 5.5.6 字符数组应用举例 #include iostream #include string using namespace std; int main( ) { void max_string(c

文档评论(0)

1亿VIP精品文档

相关文档