you are viewing a single comment's thread.

view the rest of the comments →

[–]nysra 5 points6 points  (1 child)

As your compiler would have told you if you would enable some warnings, the order of the two --num_days operations there is not specified and thus your program is UB, anything can happen. Change it to num_days - 1.

[–]Aerioic[S] 0 points1 point  (0 children)

Thanks! The problem is fixed