I want to convert a string that is inside a vector of strings (vector) into a char. The vector would look something like the following: lons = ["41", "23", "N", "2", "11" ,"E"]. I would like to extract the "N" and the "E" to convert them into a char. I have done the following:
char lon_dir;
lon_dir = (char)lons[lons.size()-1].c_str();
But I get the following error message:
cast from 'const char*' to 'char' loses precision [-fpermissive]
How do I fix that?