tokens!!
How would I break this up into tokens?
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28
|
#include <iostream>
#include <cstdlib>
#include <fstream>
using namespace std;
int main ()
{
ifstream ifs("config.ini",fstream::in);
string str; size_t found;
while (ifs >> str) {
found=str.find('=');
if (found!=string::npos) {
string a;
string b;
a = str.substr(0,found);
b = str.substr(found+1);
if (a == "ALMNT") {
//b contains a,string,of,tokens like that
....tokens??
}
else {
//...other commands
}
}
}
ifclose();
}
|
How would I got about taking string "b" and breaking it up into tokens?
From the reading I've done strtok() only works with char :\
Last edited on
Topic archived. No new replies allowed.