I found this method on the internet:
//the call to the method:
cout << convert_binary_to_FANN_array("1001");
//the method in question:
string convert_binary_to_FANN_array(string binary_string)
{
string result = binary_string;
replace(result.begin(), result.end(), "a", "b ");
replace(result.begin(), result.end(), "d", "c ");
return result;
}
But this gives
main.cpp:30: error: no matching function for call to ‘replace(__gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, __gnu_cxx::__normal_iterator<char*, std::basic_string<char, std::char_traits<char>, std::allocator<char> > >, const char [2], const char [3])’