Ad
  • Default User Avatar

    I may be a 2kyu in C, but I feel this is generally an unreliable indicator of the depth of awareness of a coder to any partiucular language. Also, I'm 100% self-taught in coding, so I am constantly filling in various gaps. So, thank you for the affirmation of my supposition.

  • Default User Avatar

    You are correct; this prompts a warning: format specifies type 'int' but the argument has type 'size_t'.

  • Default User Avatar

    Hence the warning unsequenced modification and access to 'n', about which I wonder there is a risk of U.B.

    Is it because there's no guarantee that one side or the other side of the assignment may be evaluated first?

  • Default User Avatar

    the tests free() the returned pointer, so the program would crash if you returned an automatic array

  • Custom User Avatar

    I scrolled through some solutions and I can see only ones allocating memory dynamically. What example solution would you think would fail?