Question: I am trying to write a generic library in pure c , just some data structures like stack, queue...

In my stack.h when giving name to those functions. I have questions about that.

1. Can I use such name, for example "init" as the function name to init a stack. Will there be something wrong?
2. I know maybe there exist other functions which just do other things and have the same name as "init". Then would the program be confused, especially when i both include the different init's headers.

3.I know my worry may be unnecessary, but i still want to know the principle.

Any help is appreciated, thanks.

Answer: 
> 
> Can I use such name, for example "init" as the function name to init a
>  stack. Will there be something wrong?
> 
> 
> 

Yes, if anyone else wants a function named `init`.

> 
> I know my worry may be unnecessary, but i still want to know the
>  principle
> 
> 
> 

Your worry is necessary, this (the lack of namespaces) is a serious problem in C.

* Export as few functions as possible. Make everything `static` if you can
* Prefix function names with something. For instance, instead of `init`, try `stack_init`
You don't have namespaces in C so usually you prefix every identifier with the name or nickname of your library.

```
init();

```

becomes

```
fancy_lib_init();

```