From char to long double

I have an array of characters which holds this data: '2'',''2''.''5''6'',''0''.''5'','';'. Regardless of how improper this is, for the sake of simplicity, I'll write it as "2,2.56,0.5,;". This string is what the characters hold. Now, I need to read from the array and place the data into a long double array but I have no idea how to do this.

TL;DR
I start with char "2,2.56,0.5,;" and need to end with long double {2, 2.56, 0.5} I don't even know where to start...
1) std::istringstream to be able to threat your string as stream; http://en.cppreference.com/w/cpp/io/basic_istringstream
2) std::getline with custom delimeter to read parts of string separated by comma. http://en.cppreference.com/w/cpp/string/basic_string/getline
3) std::stod to convert string to double. http://en.cppreference.com/w/cpp/string/basic_string/stof
Thanks!
Topic archived. No new replies allowed.