Create a dynamic stack based on a linked list. (C only NOT C++)
Define a union that contains members of all built-in types (int, short, long,char, float, double, long double, provide both signed and unsigned types where available) and use this union as the type that gets stored on the stack.
Provide the following functions:
push elements onto stack
pop elements from stack
return number of elements on stack
print the stack to the screen
Need .dsw project with three filles
main.c (menu using switch statements to carry out functions above)
Pushing elements onto the stack is equal to adding nodes to the linked list, popping elements is equal to deleting nodes from the linked list.
If pop and there is nothing to pop should give error message.
Finally a test main-function(seperate file) to verify that the ADT complies to specification(test to try and break program)
Comments as much as possible.
The shorter and simpler the code the better.