Try this After taking the input in variable line do this:
#include<iostream>
#include<string>
#include<sstring>
using namespace std;
void main()
{
bool flag=true;
unsigned n,i=0;
double x;
string line,str;
istringstream iss;
cout<<"input your "
getline(cin,line);
int c=0;
char * pch;
pch = strtok (line," ,");// this will work for space and comma but you can add your own specifiers
while (pch != NULL)
{
printf ("%s\n",pch);
pch = strtok (NULL, " ,");
c++;
}
return(c);// will give the length of arry.
}
solved how to decleare a 1D double array