aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--roots.cpp4
1 files changed, 3 insertions, 1 deletions
diff --git a/roots.cpp b/roots.cpp
index 0ba8fe9..4187822 100644
--- a/roots.cpp
+++ b/roots.cpp
@@ -333,7 +333,7 @@ void buildImage(unsigned char *image,const int *tally,int width,int height){
maxval=max(maxval,tally[i]);
}
- int cumul[maxval+1];
+ int *cumul=new int[maxval+1];
memset(cumul,0,(maxval+1)*sizeof(int));
for(int i=0;i<width*height;i++){
cumul[tally[i]]++;
@@ -349,6 +349,8 @@ void buildImage(unsigned char *image,const int *tally,int width,int height){
image[3*i+1]=image[3*i+0];
image[3*i+2]=image[3*i+0];
}
+
+ delete[] cumul;
}
void writePlot(int *tally,int width,int height){