It's a very easy task, but for some reason I cannot do it, I'm trying to do it for many hours already, help me please.
Make a function that has as its parameters length of 2 arrays and these 2 arrays too. It needs to assign all nonzero values from 1st array to 2nd, from left to right in ascending order and return number of significant ( that were assigned to 1st to 2nd ) elements of 2nd array.
Prototype:
Code:
size_t counter(size_t length, int input[length], int output[length]);
If it was not understandable I'll give an example.
Code:
input {1, 4, 0, -6, 0} --> output {-6, 1, 4, trash, trash}
return 3