关于字符串处理的函数,具体例子:
strcat(str1,str2);tcslen(str) 获得字符串长度tcsrchr(str, L‘\\‘) 反向搜索获得最后一个TCHAR的位置stprintf(TCHAR *buffer,const TCHAR *format [,argument] ..)获得一个格式化字符串tcsdup 给一个指针分配源字符串大小的内存并从源字符串copy值tcstok 按标记将字符串拆分tcscpy 拷贝字符串.字符串连接函数strcat(),将strSource连接到strDestination。下面是MSDN的声明:
1 char *strcat( 2 char *strDestination, 3 const char *strSource 4 ); 5 wchar_t *wcscat( 6 wchar_t *strDestination, 7 const wchar_t *strSource 8 ); 9 unsigned char *_mbscat( 10 unsigned char *strDestination, 11 const unsigned char *strSource 12 ); 13 template <size_t size> 14 char *strcat( 15 char (&strDestination)[size], 16 const char *strSource 17 ); // C++ only 18 template <size_t size> 19 wchar_t *wcscat( 20 wchar_t (&strDestination)[size], 21 const wchar_t *strSource 22 ); // C++ only 23 template <size_t size> 24 unsigned char *_mbscat( 25 unsigned char (&strDestination)[size], 26 const unsigned char *strSource 27 ); // C++ only
举例
时间: 2024-11-05 11:14:50