Skip to main content
7 events
when toggle format what by license comment
Jun 6, 2021 at 15:02 vote accept s_tatus3
Jun 4, 2021 at 9:58 comment added s_tatus3 I see and agree. Have updated the reply with the solution (this one really reproducing what I want).
Jun 4, 2021 at 9:56 history edited s_tatus3 CC BY-SA 4.0
Add current solution
Jun 3, 2021 at 19:15 comment added Dave Newton My point was that we cannot check your assumptions or provide any meaningful input without knowing what's actually happening. Comparisons generally Just Work, so if removing pos++ "fixes" it (ergo pos < DATA_SIZE forever) it means there's an issue in the time comparison. But we cannot see the any of the values being compared, so all we can do is guess.
Jun 3, 2021 at 18:55 comment added s_tatus3 Thanks. Yes, I checked the times. I compared the current_time and the scen1[pos].time. Simplified the code and checked if current_time is equal or bigger of scen1[pos].time. The output is right (using different times and intervals). So I would expect the statement working fine. I don' t know the checking of assumptions means something else of that I've already done.
Jun 3, 2021 at 16:30 comment added Dave Newton So it's blowing through the loop, which still means the time comparison is failing. Hence the repeated suggestion to check your assumptions by looking at the times. There's zero way we can help you without knowing what the data values are that are being compared, and you won't share them. This isn't an answer to the problem, it's a work-around that breaks the program.
Jun 3, 2021 at 16:21 history answered s_tatus3 CC BY-SA 4.0