title: Paint Bucket in C
body: <p>i need help.. I'm making a function that imitates the bucket in paint.. the problem comes when half the image is colored this error occurs "NTVM has encounter an illegal instruction"</p>
  
  <p>here is my "bucket" code:</p>
  
  <pre><code>void bucket(int x, int y, int fillColor)
  {
  
   if(getpixel(x,y)==getpixel(x,y+1)){
       putpixel(x,y,fillColor);
       bucket(x,y+1,fillColor);
   }
  
  
   if(getpixel(x,y)==getpixel(x+1,y)){
       putpixel(x,y,fillColor);
       bucket(x+1,y,fillColor);
   }
  
  
   if(getpixel(x,y)==getpixel(x,y-1)){
       putpixel(x,y,fillColor);
       bucket(x,y-1,fillColor);
   }
  
  
   if(getpixel(x,y)==getpixel(x-1,y)){
       putpixel(x,y,fillColor);
       bucket(x-1,y,fillColor);
   }
  
  
  }
  </code></pre>
  
  <p>supposedly the problems with "fills" algorithms is that your stack of recursion doesn't support all the calls ... at least half the drawing is colored..</p>
  
  <p>PS: I'm running it on Borland c++ v3.1 using the </p>