I have designed a program which deals about stack and its functionalities...
Code:
Just an overview of the design of the code:
struct STACK{
int value;
struct STACK * next;
};
function defined are : insert,pop, etc..
main()
{
insert();
pop();
}
My questions are :
1) I have to make this stack implementation, as a library.But how do i modify the code to facilitate my requirement ?... If this was c++, i would have had a class and member functions.
So if i create an instance of a class STACK ,then i could perform insert(),pop() etc ....as they are the member functions of the class.
But how do i bring the same concept in pure c. How do i change the structure of the program to make it ass a library so that it could be used optimally .
2)how to create a library from such .c file and link it to the main .c file.
googled results landed me on the makefile.But could not understand it properly.Can i have a clear explanation.It would be reallly really helpfull.