Why not change the locale to something that uses ',' as the radix character? Then you don't have to do any mumbo jumbo with strings:
#include <iostream>
#include <locale>
#include <sstream>
using namespace std;
int main()
{
istringstream is("12,34");
double a = 0;
is.imbue(locale("german_germany.1252"));
is >> a; // will recognize ',' as a radix
cout << a << '\n';
}