摘要: (一) 概述string和CString均是字符串模板类,string为标准模板类(STL)定义的字符串类,已经纳入C++标准之中;CString(typedef CStringT > CString)为Visual C++中最常用的字符串类,继承自CSimpleStringT类,主要应用在MFC和ATL编程中,主要数据类型有char(应用于ANSI),wchar_t(unicode),TCHAR(ANSI与unicode均可);char*为C编程中最常用的字符串指针,一般以'\0'为结束标志;(二) 构造string是方便的,可以从几乎所有的字符串构造而来,包括CStr 阅读全文
posted @ 2012-01-04 15:52 gaoxw0511 阅读(2021) 评论(0) 推荐(0) 编辑
摘要: File Names in C++For historical reasons, the IO library uses C-style character strings (Section4.3 , p. 130 ) rather than C++ strings to refer to file names. When we callopen or use a file name as the initializer when creating an fstream object, theargument we pass is a C-style string, not a library 阅读全文
posted @ 2012-01-04 11:30 gaoxw0511 阅读(446) 评论(0) 推荐(0) 编辑