std::basic_string::operator[]
来自cppreference.com
                    
                                        
                    < cpp | string | basic string
                    
                                                            
                    |  | 该页由英文版wiki使用Google Translate机器翻译而来。 
 该翻译可能存在错误或用词不当。鼠标停留在文本上可以看到原版本。你可以帮助我们修正错误或改进翻译。参见说明请点击这里. | 
| reference       operator[]( size_type pos ); | ||
| const_reference operator[]( size_type pos ) const; | ||
返回指定位置处的字符
pos的参考。没有执行边界检查.原文:
Returns a reference to the character at specified location 
pos. No bounds checking is performed.If pos==size(),
- const版本返回一个引用到的字符值CharT()(空字符)。 (C++11前)原文:The const version returns a reference to the character with value CharT() (the null character). (C++11前)
- 这两个版本返回一个引用到的字符值CharT()(空字符)。修改的空字符导致未定义的行为,通过非const引用。 (C++11起)原文:Both versions returns a reference to the character with value CharT() (the null character). Modifying the null character through non-const reference results in undefined behavior. (C++11起)
| 目录 | 
[编辑] 参数
| pos | - |  返回的字符位置 | 
[编辑] 返回值
引用到所请求的字符
[编辑] 复杂度
常数
[编辑] 另请参阅
| 访问指定位置的字符,带边界检查 (公共成员函数) | 


