Ad
  • Custom User Avatar

    British imperial system is really bad :\

  • Custom User Avatar

    It is indeed a use of recursion, though I, for one, don't think it's good to call it "Best Practises". To me this code is harder to understand that its iterative equivalent.

  • Custom User Avatar

    Interesting idea with setting the first value of minimum_element to INT_MAX, though I dislike declaring multiple variables in one "statement"(is that how it's called when you do int a, b;?).

    What I don't get is why do you not declare int i = 0 inside for loop, and instead hold the int i for the whole function;

  • Custom User Avatar

    Doesn't get more pythonic than that.

  • Custom User Avatar

    Indeed it looks like something that's "clever"(though at that level there isn't much space for using cleverness, in particular in C). I for example, dislike using while loops when a for loop works(along with the better readability to me), and how it mutates the value.

  • Custom User Avatar

    Note: I'd be wary of using ASCII codes. I basically never see any reason to write into a char through anything other than char ch = 'a';. It makes it more difficult to read when using numeric code, vs a "normal" way of writing the character itself into the char.