Ad
  • Default User Avatar

    translations should try to be idiomatic and use the datatypes/techniques that are usual in their language. output parameters and programming by mutation are much more common in C than in other (higher-level) languages

  • Default User Avatar

    your code contains undefined behavior, your while loop will happily iterate past the end of the array and overwrite arbitrary memory

  • Default User Avatar

    I solved this kata in C and Rust, and I have a question. Why does the function in C mutate the array in place, but in Rust it requires to create a new vector? In Rust, we can use mutable slice to change data in place as well:

    fn move_zeros(arr: &mut [u8]) { todo!() }

  • Default User Avatar

    It seems that this is the only one solution that does not use temporary memory allocations, isn't it?