基于C的App / Project的文件和文件夹结构

基于C编程语言的App / Project的一般结构是什么? libs,包括头文件。 等等

什么是class级结构。 (在OOps中)需要具有可扩展性和其他function。 像main.cpp main.h这样的东西

有任何人有任何良好的链接或图像或PDF格式?

大多数项目遵循以下单一层次结构:

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) 

对于目录布局/类结构,我建议阅读此内容

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

该链接谈论Java,但它适用于任何语言(甚至非OOP)

您可能也会发现这很有趣

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

您可以做的是在同一个域中找到一个开源项目 ,研究他们的项目结构并根据需要进行调整。

我想没有共同的指导方针(至少,我没有听说过)。 每家公司似乎都有自己的做法和建议。 我想,你可能只依赖自己,做任何适合你当前需要的事情。

以下是Google C ++风格指南的链接,如果您还没有看到它: https : //google.github.io/styleguide/cppguide.html (他们有很多想法,但我不接受其中一些,所以这是一个选择的问题)

这是一些其他随机指南: http : //geosoft.no/development/cppstyle.html

我猜你可以看看那些,但没有一般的经验法则。 一切都取决于你的确切任务。

根据function创建单独的库,为所有头文件制作单个包含如果是C使用.h或者如果是C ++则使用.hpp格式。然后有单个主文件跟随make来构建所有库

OOPS将遵循Main.cpp和Main.hpp格式