遵循restful风格_我遵循的C编程风格

遵循restful风格

C programming language allow any style the programmer like. A good style can make the code easy to understand and maintain, while a bad style will make the project a nightmare.

C 编程语言允许程序员喜欢任何样式 。 好的样式会使代码易于理解和维护,而不好的样式会使项目成为噩梦。

This is the C programming styles that I follows:

这是我遵循的C编程风格:

1. For each source file (*.c), there is a header file (*.h) that have the same name with it as it’s interface.

1.对于每个源文件(* .c),都有一个与接口名称相同的头文件(* .h)。

2. The header file starts with

2.头文件以

#ifndef _HEADER_NAME_H
# define _HEADER_NAME_H

#ifndef _HEADER_NAME_H
#定义_HEADER_NAME_H

And end with:

并以:

#endif // _HEADER_NAME_H

3. #include is only used in source file usually. ONLY when it is really necessary, #include can be used in header file.

3. #include通常仅在源文件中使用。 仅在确实需要时,才可以在头文件中使用#include。

4. There is NO definition in header file.

4.头文件中没有定义。

5. Global variable defined in source file that is visible outside the module is declared as extern variable in the relevant header file. Global variable is used only when it is really necessary.

5.在源文件中定义的,在模块外部可见的全局变量在相关头文件中声明为extern变量。 全局变量仅在确实必要时使用。

An example that follow this style is mrcc.

遵循此样式的示例是mrcc

翻译自: https://www.systutorials.com/the-c-programming-style-that-i-follow/

遵循restful风格

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值