#include <cstdlib>
#include <iostream>
#include <stdlib.h>
#include <cstring>
usingnamespace std;
//////////////////////////////////
longdouble mstold(char para[])
{
longdouble money;
int n=0;
char karakter[100];
int len = strlen(para);
for(int i=0; i<len+1; i++)
{
if(para[i] >= '0' && para[i] <= '9')
{
karakter[n] = para[i];
n++;
}
}
money = _atold(karakter);
return money;
}
int main(int argc, char *argv[])
{
char choice;
char string[100];
longdouble para = 0;
////////////////////////////////////////
do
{
cout << "Enter money: ";
cin >> string;
para = mstold(string);
cout << "Your cash is: " << para << endl;
cout << "Do another ?(y/n)" ;
cin >> choice;
} while ( choice == 'y');
system("PAUSE");
return EXIT_SUCCESS;
}
problem is line 24.For example: "$999,4223,46343" convert to long double.but that doesn't works.But i change atold to atof it is working.but i want to convert long double