Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6759621
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T13:58:02+00:00 2026-05-26T13:58:02+00:00

I am trying to write a generic library in pure c , just some

  • 0

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.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T13:58:02+00:00Added an answer on May 26, 2026 at 1:58 pm
    1. init() might be okay (if you’re including your library into something else as an actual library, rather than compiling its source in), but it’s better practice to use something like stack_init(), and to prefix your library’s functions with stack_ or queue_, etc.

    2. A program using your library may get confused, depending on the order the libraries are included, see #1.

    As far as the principles go, the linker (on Linux, anyway) will look for symbols, and there’s an ordering to how those symbols will be found. For more information, you can check out the man page for dlsym(), and specifically for RTLD_NEXT.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm trying to write some documentation and can't think of a generic name for
I'm trying to write some generic structures. Essentially, what I need for my purpose
I'm trying to write a generic XML to Core Data parser using libxml2. Since
I am trying to write some generic LINQ queries for my entities, but am
I'm struggling while trying to write generic methods to save and load data from
I'm trying to write some reasonably generic networking code. I have several kinds of
I am trying to write a generic comparison routine. However, some of the items
I'm trying to write generic method to cast types. I want write something like
I'm trying to write some generic http response handler functions that sometimes open UIAlertViews.
I am trying to write some generic linqtoSQL which performs operation on entities based

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.