Design and implement a stack class (i.e. struct with accompanying functions) in the C language. The interface should allow storing any data type, including complex structures (strings, int, float, etc). You can use the "malloc" and "free" functions.
Sample:
// create a stack of capacity 5 with char data type
struct stack *st = newStack(5, CHAR);
st.push('a');
st.push('b');
// create a stack of capacity 5 with INTEGER data type
struct stack *st2 = newStack(5, INTEGER);
st2.push(3);
st.push('5');