B
BBryant
Probably a fundamental I am missing somewhere, trying to convert from
VB after 5 years is proving more difficult than I expected
How can I get the boost:tokenizer output into a char array? With this,
it errors (of course, because the tok_iter isn't a char). I can change
szDataBuf to a string, and C-style type cast *tok_iter to a string to
get it to compile, but the program crashes when attempting to fill the
array.
int ParseData(char * sInput, char seperator) {
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
std::string a(sInput);
char szChr1 = 1;
char szDataBuf[18][256];
boost::char_separator<char> sep(&szChr1);
tokenizer tokens(a, sep);
int iIterator = 0;
for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter !=
tokens.end(); ++tok_iter)
{
szDataBuf[iIterator] = *tok_iter; <---- ERROR LINE
iIterator++;
}
return 0;
}
VB after 5 years is proving more difficult than I expected
How can I get the boost:tokenizer output into a char array? With this,
it errors (of course, because the tok_iter isn't a char). I can change
szDataBuf to a string, and C-style type cast *tok_iter to a string to
get it to compile, but the program crashes when attempting to fill the
array.
int ParseData(char * sInput, char seperator) {
typedef boost::tokenizer<boost::char_separator<char> > tokenizer;
std::string a(sInput);
char szChr1 = 1;
char szDataBuf[18][256];
boost::char_separator<char> sep(&szChr1);
tokenizer tokens(a, sep);
int iIterator = 0;
for (tokenizer::iterator tok_iter = tokens.begin(); tok_iter !=
tokens.end(); ++tok_iter)
{
szDataBuf[iIterator] = *tok_iter; <---- ERROR LINE
iIterator++;
}
return 0;
}