|
|
back to boardStack overflow I dont know if I use the array with size 131072 I get result "access violation" if I use the size 131073 I get the result "stack overflow" so how I get the right way to resolve the problem, sorry for my bad english; #include <stdio.h> #include <math.h> int main() { int index = -1; double stack[131073]; while(scanf("%lf", &stack[++index]) != EOF); for(; top > 0;printf("%.4lf\n", sqrt(stack[--index]))); return 0; } Re: Stack overflow Posted by Jane 3 Jul 2012 00:09 #include <stdio.h> #include <math.h> double stack[131073]; int main() { int index = -1; while(scanf("%lf", &stack[++index]) != EOF); for(; index > 0;printf("%.4lf\n", sqrt(stack[--index]))); return 0; } Re: Stack overflow Posted by Coder 25 Nov 2012 21:24 Did you resolve the problem? |
|
|