0

Hello folks,

I have some doubt regarding the creation of header files and libraries using C.

Suppose I am defining all the functionalities related to the Stack and I wan to create it as library, for eg. stack.C which will get me the object file, Stack.o in Linux OS and one file for definitions which I would include in the other client programs stack.h. Now suppose I want to create as many Stacks as I want just by including this file in the client programs. Now what should I use to accommodate this. One way is to use pointers in the stack.c file. Is there any other better option? Even using structures in the source code won't allow me to define functions in them.

Please help me out.
:S

3
Contributors
2
Replies
3
Views
7 Years
Discussion Span
Last Post by Narue
0

It really depends on what and how you wrote your code...Could we see it so as to make an informed decision.

0

I'm not sure I understand what you're asking. It sounds a bit like you want to create an abstract data type but don't know how. If that's the case, you can check out the libraries offered here for one such method. The data structures are a bit more complex than a stack, but the basic ADT setup would the same if I wrote a stack library.

If that's not what you want, be more specific.

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.