I\'m relatively new to the C programming language, and I\'m trying to figure out how to create a function that can accept different types of data as parameters. The function is
The answer is quite simple. You do need a function for this task. Just try this piece of code
#define len(array) sizeof(array)/sizeof(*array)
and that's it.
Important note: As pointed out in the comments, this will not work for dynamically allocated arrays.