Ad
  • Default User Avatar

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

  • Default User Avatar

    hold the phone! I have been trying to guess the maximum size required when [creating a variable on the heap? / allocating memory on the heap?]. I'm not even sure how to say that.
    why does char *ret = calloc(1,1) work, when a 1 character array is not long enough for the task?!?

  • Default User Avatar

    When I created my buffer array, I first attempted to make each dimension of the array size n (int buff[n][n];), but the compiler told me I could not make a variable sized array. How would I go about sizing this buffer array in a less wasteful way?

  • Custom User Avatar

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

  • Default User Avatar

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

  • Default User Avatar

    May I bother someone to discuss the syntax for index incrementation technique here?
    I learned, through this exercise that (*i1)++ != *i1++; however, I'm still not entirely clear why.
    I think that because no assignment is being made to or from *index1 in the incrementation area of the for loop, that ++i is identical in function to i++.
    I also think that *i1++ increments the pointer (address?) and (*i1)++ increments the dereferenced value of the pointer.
    I guess my question is whether I'm uderstanding correctly, and whether ++*index1 instead of *index1++ has different syntax rules.

  • Default User Avatar
  • Default User Avatar

    didn't get that precision with your casio wristwatch, did you?

  • Default User Avatar

    May I bother someone to review my solution? I receive errors intermittently (on the random tests) that are related to memory allocation (I think?) I'm only about half way through my primer and making a lot of guesses regarding memory management...

    errors i receive:
    free(): invalid next size (fast)
    free(): invalid pointer
    realloc(): invalid next size

  • Custom User Avatar

    Was multiplying strlen(camelCase) by two a a worst case...

    Yes, I think that was my reasoning for the 2x (It's been a while).

    Any overreach is cleaned up by the realloc at the end so I am not left holding more memory than was actually needed.

  • Default User Avatar

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

  • Default User Avatar

    Thank you for the insight. Was multiplying strlen(camelCase) by two a a worst case, to avoid the extra 2 lines?

  • Default User Avatar

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

  • Default User Avatar

    credit: @cvetkovem for the [unicode?].

  • Default User Avatar

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

  • Loading more items...