Creative Basic
Running the prog Heapsort.cba produces an error when you enter the number 555
The error says Value out of range on line 68
Gosh .. how on earth did you spot that Allan .. ;D
The beauty of CBasic is you can just put a 'Stop' statement ahead of the error line, and have a look what's going on.
In this case it's an array overflow, since array A[] is only set for 554 elements.
Just change the def statement for A[] to:
def testarray[maxsize+1]:string
and all then seems to work .. :)
best wishes,
Graham
I'm moving this to the CBasic area, but it looks like it is taking me two hops. :P
Edit: Oops again - I am not a Moderator here so I can't move it.