Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

File and Folder structure of a App/Project based in C [closed]

What would be the general structure of a App/Project based in C Programming language. libs, includes, header files. etc etc.

What would be the class structure. (in OOps) need to be scalable and other features. Something like main.cpp main.h

does any one have any good links or images or pdf?

like image 279
coderex Avatar asked Mar 09 '10 08:03

coderex


3 Answers

Most of the projects follow a single hierarchy as follows:

project
\_ conf\   --> configuration files (Unix/Linux projects might prefer an 'etc' folder)
\_ src\    --> main source (for C++ projects, headers and sources go along, but if 
              your project is a library then separating include files for others 
              is a better practice)
\_ src\module1\ --> for each sub module (for multiple files having related contents,
                   it is better to separate them to their own subfolders)
\_ doc\    --> documentation 
\_ include\ --> (for library projects, the distributable include files)
\_ os\     --> OS (platform dependent) files (uch as makefiles, package building
              scripts..)
\_ res\    --> resources required for compilation but not source files (icons, etc.)
\_ MAKEFILE --> makefile script for building the project
\_ README   --> introductory document (might refer to doc\README)
\_ INSTALL  --> Installation document (might refer to doc\INSTALL)
like image 132
Osman Avatar answered Oct 21 '22 10:10

Osman


For the directory layout/class structure I suggest reading this

http://www.javapractices.com/topic/TopicAction.do?Id=205

The link talks about Java but it applies to any Language (even non- OOP)

You might also find this interesting

http://www.gnu.org/prep/standards/html_node/index.html

like image 27
kazanaki Avatar answered Oct 21 '22 10:10

kazanaki


What you could do is find an open-source project in the same domain and study their project structure and adapt it as needed.

like image 39
JRL Avatar answered Oct 21 '22 09:10

JRL