My code is generaing a compile error on the append line. it doesn't like ch[1]. i tried "ch" which compiled fine but gives the pointer or something else very very odd.
The function sends in a line of numbers and characters and returns just the numbers. Useful for stripping numeric fields of common delimiters (-,.#)
Code:void ReduceVal(std::string& strval) { char ch[1]; std::string::iterator p = strval.begin(); std::string newval = ""; while(p != strval.end()) { ch[1] = (char) (*p); if (isdigit(ch[1])) { newval.append(ch[1]); } p++; } strval = newval; }