I'm making this scientific calculator for my project at uni [ which calculates values of various physical quantities ] and I am stuck with a problem in this part of the code :
1 2 3 4 5 6 7 8 9
|
int soln[81];
long double ctr=(1.0*pow(10,80));
long double j;
for(j=80;j>=0;j--)
{
soln[j]=(ctr)%10;
ctr=10;
}
|
What I actually need to do is store the long double number 1 * 10^80 into an array of 81 elements, soln.
Please dont show me how to do that, but show me
how to do that using the same kind of looping structure using which I have tried , because I will have to use similar loops to convert numbers into array again and again in the program.
I need to know how to resolve the two errors :
1> subscript is not of integral type
2> '%' : illegal, left operand has type 'long double'
Thank you for taking your time out,
G'day