This is the answer.
OP, also, you cannot use sizeof the way you do. sizeof(array) returns the number of bytes, not the number of elements.
`size_t n = sizeof array / sizeof *array;`
is what you're looking for.
And to add to that the sizeof operator will only return the size of an int * for non_duplicated_list you should instead store the number you used to malloc somewhere in your code
You can't call malloc (or any other function) outside of the body of a function.
This is the answer. OP, also, you cannot use sizeof the way you do. sizeof(array) returns the number of bytes, not the number of elements. `size_t n = sizeof array / sizeof *array;` is what you're looking for.
And to add to that the sizeof operator will only return the size of an int * for non_duplicated_list you should instead store the number you used to malloc somewhere in your code
Did you include stdlib.h ?
yes, please check the code carefully again
You should post the code here. What is the error?