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

  • Home
  • SEARCH
  • 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 771973
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T18:44:17+00:00 2026-05-14T18:44:17+00:00

Now that I got my head wrapped around the ‘C’ language to a point

  • 0

Now that I got my head wrapped around the ‘C’ language to a point where I feel proficient enough to write clean code, I’d like to focus my attention on project architecture guidelines. I’m looking for a good resource that coves the following topics:

  1. How to create an interface that promotes code maintainability and is extensible for future upgrades.
  2. Library creation guidelines. Example, when should I consider using static vs dynamic libraries. How to properly design an ABI to cope with either one.
  3. Header files: what to partition out and when. Examples on when to use 1:1 vs 1:many .h to .c
  4. Anything you feel I missed but is important when attempting to architect a new C project.

Ideally, I’d like to see some example projects ranging from small to large and see how the architecture changes depending on project size, function or customer.

What resource(s) would you recommend for such topics?

  • 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-14T18:44:18+00:00Added an answer on May 14, 2026 at 6:44 pm

    Whenever I got serious writing C code, I had to emulate C++ features in it. The main stuff worth doing is:

    • Think of each module like a class. The functions you expose in the header are like public methods. Only put a function in the header if it part of the module’s needed interface.

    • Avoid circular module dependencies. Module A and module B should not call each other. You can refactor something into a module C to avoid that.

    • Again, following the C++ pattern, if you have a module that can perform the same operations on different instances of data, have a create and delete function in your interface that will return a pointer to struct that is passed back to other functions. But for the sake of encapsulation, return a void pointer in the public interface and cast to your struct inside of the module.

    • Avoid module-scope variables–the previously described pattern will usually do what you need. But if you really need module-scope variables, group them under a struct stored in a single module-scope variable called “m” or something consistent. Then in your code whenever you see “m.variable” you will know at a glance it is one of the module-scope structs.

    • To avoid header trouble, put #ifndef MY_HEADER_H #define MY_HEADER_H declaration that protects against double including. The header .h file for your module, should only contain #includes needed FOR THAT HEADER FILE. The module .c file can have more includes needed for the compiling the module, but don’t add those includes into the module header file. This will save you from a lot of namespace conflicts and order-of-include problems.

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

Sidebar

Related Questions

Possible Duplicate: JavaScript: formatting number with exactly two decimals Now that I have got
Well, now that I've finally got my stupid ODBC stuff configured, I took a
I've got a int, that is changed in a previous method, that now has
i have done some learning on struts based on one project that i got.Now
I've got some numbers that is now larger than INT can handle. This is
Right now we've got a hard-coded set of characters that we check for --
I've got an app that's in invite-only beta right now. Problem is, I can't
I've got a class that manages a shared resource. Now, since access to the
I've got a WinForms project that I've had for quite some time, and now
I've got a MySQL database that stores image information. Right now it only has

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.