You start at 1 instead of 0, and you overrun the end of the array with aarry[ascend+1]. Oops. I think you meantCode:int ascend; for(ascend = 1; ascend < sizearr;){ if (aarry[ascend] < aarry[ascend + 1]){
BTW, pronouncable variable names wouldn't hurt. "aarry" is just painful . . .Code:for(ascend = 0; ascend < sizearr-1; ) {
dwk
Seek and ye shall find. quaere et invenies.
"Simplicity does not precede complexity, but follows it." -- Alan Perlis
"Testing can only prove the presence of bugs, not their absence." -- Edsger Dijkstra
"The only real mistake is the one from which we learn nothing." -- John Powell
Other boards: DaniWeb, TPS
Unofficial Wiki FAQ: cpwiki.sf.net
My website: http://dwks.theprogrammingsite.com/
Projects: codeform, xuni, atlantis, nort, etc.