8

Try = -1

if (try == -1) {
Do this
}

My code ends up not triggering the if.

Comments
  • 6
    Cuz the first try is capitalized :3
  • 6
    Missing semi-colon
  • 0
    Yeah, it is here, but it's not in the code. iOS keyboard quirks. Thanks though.
  • 0
    Yeah, I wasn't too worried about correctness of my pseudocode for the rant.
  • 0
    Figured, was just giving you a hard time. I presume you're coding in C?
  • 0
    Yeah. I'm probably going to find something very small and context-dependent and kick myself for a week, honestly. XD
  • 0
    That's usually how it goes :3 it helps me to get up and walk away from it for a bit
  • 0
    I find myself doing that a lot with C.
  • 2
    Don't know C, but if its a float, then that's expected
  • 0
    No, it's an int. I checked data types a couple times.
  • 1
    Change if to while see what happens lol
  • 0
    I've tried a couple different conditionals. I think it's an issue elsewhere.
  • 0
    Put a print immediately before the if
  • 0
    Yep. I did. try is absolutely -1. Im dealing with a multiple-forked process which is where I think my major issue is arising. Probably just a very simple issue with control flow.
  • 0
    @Romulus10 can you breakpoint it at the if? Tried disassembling the code at that point?
  • 1
    Yeah that's my project for today...
  • 2
    AHA!
    It's segfaulting on in its child processes! The cheeky little....
  • 2
    You know what I'm a complete moron. It's a null pointer segmentation fault. It had nothing to do with the if.
  • 0
    @Romulus10 well we've all done it... :)
  • 0
    Null pointers are so easy in C. I adore the language but it's a killer sometimes.
  • 1
    @Romulus10 Imagine an OS where page 0 was mapped so a NULL pointer dereference didn't segfault! Even worse.... :)
  • 0
    @Romulus10 😂😂😂😂 I wish I was here earlier
  • 2
    Things like these are why my dev environment is set up how it is.
Add Comment