正在加载图片...
char& string operator [ (inti /按串名提取串中第i个字符 if(i<0 &&i>=curLen) {cout<<“串下标超界!m”;ext(1);} return chi 例:串st=“ university”, 使用示例 newst=st; newChar=stl; 数组赋值 newst=“ university 提取字符 new Char=‘nchar& String :: operator [ ] ( int i ) { //按串名提取串中第 i 个字符 if ( i < 0 && i >= curLen ) { cout << “串下标超界!\n ”; exit (1); } return ch[i]; } 例:串 st = “university”, 使用示例 newSt = st;newChar = st[1]; 数组赋值 newSt = “university” 提取字符 newChar = ‘n’
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有