Exception when comparing an (int)double and (int)int

前端 未结 3 1142
灰色年华
灰色年华 2021-01-27 10:36

Hey so i\'m using the pdCurses lib and stringStream to calculate and make a 5 character long string that represents a clock. It shows like 00:00, 0:00, 00.00, or 0.000. However

3条回答
  •  抹茶落季
    2021-01-27 10:59

    There's not really enough to go on here, but my guess is that the assertion is from the time_s.insert(0, min) call that's in the line along with the if((int)time >= 600) - the string is performing some reallocation and the heap has been corrupted (maybe by whatever is happening in the loop at the top of the function, but maybe somewhere else entirely).

    If you run this in a debugger and have it catch the assertion, what does the call stack look like?

    What's happening in:

    for(int r = 0;r

提交回复
热议问题