现在的位置: 首页 > 综合 > 正文

记录文件操作及其相关字符串操作

2014年09月11日 ⁄ 综合 ⁄ 共 545字 ⁄ 字号 评论关闭

1、ReadFile

第一次存到TCHAR数组中,发现日文有乱码

第二次存到char数组中,再将char转tchar,没问题

2、

CString TCHAR TCHAR* char

#ifdef   UNICODE     
typedef   wchar_t   TCHAR;     #else     
typedef   unsigned   char   TCHAR;     #endif     
typedef   unsigned   char   CHAR;     
typedef   unsigned   wchar_t   WCHAR;     
由此可以看出,CHAR实施上就是unsigned char,WCHAR为宽字符,而TCHAR根据是否支持unicode而不同。在程序使用sizeof(TCAHR),当默认设置时,这个值是1;当定义UNICODE宏时,这个值是2。

TCHAR,char是可以同整型互换的类型。 
char*、TCHAR*转换CString  CString str(****) 

CString中特别有用的函数

int Find( TCHAR ch ) const;

int Find( LPCTSTR lpszSub ) const;

int Find( TCHAR ch, int nStart ) const;

int Find( LPCTSTR pstr, int nStart ) const;

抱歉!评论已关闭.