关于用C举办code文件最好的文章 [英] best articles about organizing code files in C

查看:110
本文介绍了关于用C举办code文件最好的文章的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

你能推荐我应该怎么读/为了使在C良好的组织code学到什么?

Can you recommend me what should I read/learn in order to make a well organized code in C?

一个我要学习的东西是分裂的项目在h和.c文件的原则,所发生的位置和原因,变量命名,何时使用全局变量...

One of the things I want to learn is the principles of splitting project in .h and .c files, what goes where and why, variable naming, when to use global variables ...

我感兴趣的书籍和文章的处理这个特定的问题。

I am interested in books and articles that deal with this specific problem.

推荐答案

这涵盖了很多这(对于C和C ++)一本好书的大规模C ++软件设计,由约翰·洛科什的:

A good book that covers a lot of this (for both C and C++) is Large Scale C++ Software Design, by John Lakos:

另外,一个好的经验法则要记住的是永远不要做任何事情,在头文件中分配内存

Also, a good rule of thumb to remember is "Never do anything that allocates memory in a header file"

这篇关于关于用C举办code文件最好的文章的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆