还是用到了万恶的strtok
#include
#include
#include
#include
#include
#include
#include
using namespace std;
int main()
{
ifstream f("x.cfg");
string str;
while(getline(f,str))
{
if(str[0]=='[')
cout< else
{
const char* needle="=";
char* ccc=const_cast(str.c_str());
char* c=strtok(ccc, needle);
if(c)
cout<<"F:"< c = strtok(NULL, needle);
if(c)
cout<<"R:"< }
}
return 0;
}
阅读(994) | 评论(0) | 转发(0) |