• katy ✨
    link
    208 months ago

    turned out to be a semicolon

      • Victoria
        link
        168 months ago

        fun situations can arise when you write , instead of ; For those not in the know, in c++ the comma operator evaluates the left expression, discards the value, then evaluates the right expression and returns the value. if you now have a a situation like this

        int i = 0,
        printf("some message");
        

        i has a completely different value, since it actually uses the return value of printf instead

    • @rob64@startrek.website
      link
      fedilink
      48 months ago

      I’ll just write thousands of lines of code inside a global object… I’m sure I won’t put a semicolon where a comma should be…