Accessing Individual Characters in a CString

来源:互联网 发布:外服盒子mac 编辑:程序博客网 时间:2024/05/17 07:45

You can access individual characters within a CString object with theGetAt and SetAt member functions. You can also use the array element, or subscript, operator ([ ] ) instead of GetAt to get individual characters (this is similar to accessing array elements by index, as in standard C-style strings). Index values forCString characters are zero-based.

可以使用GetAt()和SetAt()方法去访问CString对象的单个字符,当然也可以像使用C字符数组下标那样使用[]操作符去访问