正在加载图片...
String& string operator((int pos, int len)( ∥从串中第pos个位置起连续提取len个字符 /形成子串返回 String* temp= new Strings;动态分配 if(pos≤0‖ posten-1>= maxlen‖len<0){ temp->curLen=0; /返回空串 temp->ch 0=0; eise /提是取子串 if( postlen-1>=curLen) len=curLen- pos;String& String :: operator ( ) (int pos, int len) { //从串中第 pos 个位置起连续提取 len 个字符 //形成子串返回 String * temp = new String; //动态分配 if (pos<0 || pos+len-1 >= maxLen || len<0) { temp->curLen = 0; //返回空串 temp->ch[0] = '\0'; } else { //提取子串 if ( pos+len -1 >= curLen ) len = curLen - pos;
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有