有其他方法实现strtok吗? 为了从一字串里分段提取子串,常用strtok函数。请问,诸位还有使用其他方法吗? 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 CString::Find//typedef CStringT< TCHAR, StrTraitATL< TCHAR > > CAtlString;CAtlString s( "abcdef" );_ASSERT( s.Find( 'c' ) == 2 );_ASSERT( s.Find( "de" ) == 3 );CAtlString str("The waves are still");int n = str.Find('e', 5);_ASSERT(n == 7); boost::tokenizer#include<boost/tokenizer.hpp>void path_to_components_que(LPCTSTR cur_dir_buf,std::deque<tchar_string>& qque){ typedef boost::tokenizer<boost::char_separator<TCHAR>,tchar_string::const_iterator,tchar_string > tokenizer; boost::char_separator<TCHAR> sep( _T("\\")); tchar_string str = cur_dir_buf; tokenizer tokens(str, sep); tokenizer::iterator tok_iter = tokens.begin(); tchar_string group_element; while(tok_iter!=tokens.end()) { group_element = *tok_iter; qque.push_back(group_element); tok_iter++; } if(!PathIsDirectory(cur_dir_buf) && qque.size()>1) { qque.pop_back(); }} 要这么多方法干嘛,看楼上的星星们mfc,atl,stl全部都出来了哈 查找文件,FindNextFile参数 修改界面字体的问题 安装VC6之后,再安装MSDN2004,怎么VC找不到MSDN呢? 关于文件夹。 谁能给我一个VC+SQLServer的简单的例子? 调查各位正在使用的VC的版本? 关于数据结构的问题,平衡二叉树的删除算法? 接口函数名称过长 远程调用COM+组件,它咋就不行呢? windows 控制台程序中函数递归调用,出错拉!!! 有没有办法实现整个文件夹拷贝? 如何识别其他外部程序窗口中的多个同类控件(如LsitCtrl)?
_ASSERT( s.Find( 'c' ) == 2 );
_ASSERT( s.Find( "de" ) == 3 );CAtlString str("The waves are still");
int n = str.Find('e', 5);
_ASSERT(n == 7);
#include<boost/tokenizer.hpp>
void path_to_components_que(LPCTSTR cur_dir_buf,std::deque<tchar_string>& qque)
{
typedef boost::tokenizer<boost::char_separator<TCHAR>,tchar_string::const_iterator,tchar_string > tokenizer;
boost::char_separator<TCHAR> sep( _T("\\"));
tchar_string str = cur_dir_buf;
tokenizer tokens(str, sep);
tokenizer::iterator tok_iter = tokens.begin();
tchar_string group_element;
while(tok_iter!=tokens.end())
{
group_element = *tok_iter;
qque.push_back(group_element);
tok_iter++;
}
if(!PathIsDirectory(cur_dir_buf) && qque.size()>1)
{
qque.pop_back();
}
}