File and Folder structure of a App/Project based i

2019-02-03 14:48发布

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?

5条回答
甜甜的少女心
2楼-- · 2019-02-03 14:50

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

查看更多
forever°为你锁心
3楼-- · 2019-02-03 14:51

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

查看更多
老娘就宠你
4楼-- · 2019-02-03 15:01

I guess there are no common guidelines (at least, i've heard of none). Every company seem to have its own practices and recommendations. You may only rely on yourself and do whatever suits your current needs, i think.

Here's a link to the Google C++ Style Guide, if you haven't seen it already: https://google.github.io/styleguide/cppguide.html (they've got lots of ideas there, but i don't accept some of them, so it is a matter of choice)

Here's some other random guideline: http://geosoft.no/development/cppstyle.html

I guess you may take a look at those, but there is no general rule of thumb. Everything depends on your exact task.

查看更多
啃猪蹄的小仙女
5楼-- · 2019-02-03 15:04

Create individual libraries according to the functionality,make single include for all header files If it is C use .h or If it is C++ use .hpp format .then have single main file followed make to build all the libraries

OOPS will follows Main.cpp &Main.hpp format

查看更多
小情绪 Triste *
6楼-- · 2019-02-03 15:09

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)
查看更多
登录 后发表回答