Of course you can. Declare the array parameter as a pointer to void, add a parameter that tells the function what the type is, use the type parameter in a switch statement or if-then-elses, and cast the array parameter appropriately in each case.
The afforementioned qsort function is only slight twist on this in that it requires a function parameter that works for only one type, so the case statement and casting is obviated.
Note that a template function in C++ doesn't do what you described. It just creates a separae functions for each type. And of course you can do that in C also. In fact, that would raise less objections from your peers than casting.