Ad
  • Custom User Avatar

    So celver your solution is!

  • Custom User Avatar

    The C-string ends with a NUL-character and && is evaluated lazily, meaning that if the first statement is false/0 then the right hand statement will not be evaluated. So if ants[0] is NUL, ants[1] nor ants[2] would be accessed. Same if ants[1] is NUL.

  • Custom User Avatar

    Please correct me if I am wrong. I think there is a possibility of going out of bounds while de-referencing *(ants+1) or *(ants+2) in condition "if(*ants == 'a' && *(ants+1) == 'n' && *(ants+2) == 't')"

  • Custom User Avatar

    Fixed it, felt slightly hacky

  • Custom User Avatar

    This comment is hidden because it contains spoiler information about the solution