|
|
back to boardwhy stack overflow #include <stdio.h> #include <math.h> int main() { double d; int n = 0; double vect[1024*128]; while (scanf("%lf", &d) != EOF) vect[n++] = sqrt(d); while (--n >= 0) printf("%.5lf\n", vect[n]); return 0; } Re: why stack overflow "double vect[1024*128];" You can use "malloc" or "new" operator. Re: why stack overflow Posted by Maximus 17 Mar 2011 03:05 Or you can allocate memory as a global variable. (Before line: int main(void)) |
|
|