当前位置:网站首页>C language programming specification
C language programming specification
2022-07-03 09:10:00 【BBQ】
C Language programming specifications
1. In a source file , The header file contains 、 Macro definition 、 Structure consortium definition 、 Function definitions and so on An area of your own Definition , Don't mix ;
2. The header file contains :
● If it is an official header ,#include <stdio.h>
● If it is a user header file :#include “bsp_can.h”
● reason :< > When compiling, you will first search from the system directory file ," " When compiling, you will first search from the user directory , Speed up compilation
3. Structure consortium definition :
● Both the structure and the consortium need to use typedef redefinition ;
● Redefined names are capitalized + Underline _ The way , It is similar to the naming of macro definitions , The name of structural weight definition is S_XXX(S Representative structure ), The name of combined weight definition is U_XXX(U On behalf of the Consortium );
● Variables defined in the structure , start 4 A space ( Or click TAB key );
● The opening curly braces own a line , The end curly bracket is followed by the redefined name ;
typedef struct
{
uint8_t h;
uint8_t s;
uint8_t v;
uint8_t res;
}S_HSV;
4. Variable naming :
● Naming of small hump , That is, the beginning letter of the first word is lowercase + The following words are capitalized
Such as :
int armorAreaMax;
● When defining pointer variables ,* Followed by the variable name ;
Such as :
int *armorAreaMax;
● When defining multiple variables with commas , There should be a blank space after the comma ;
Such as :
int armorAreaMax, armorAreaMin;
● Try not to use abbreviations , In addition to the Convention commonly known , Such as buf Instead of buffer Yes. ,tmp,rx,tx;
● Cannot use Chinese Pinyin ;
5. Macro definition
● Name in all uppercase and underlined form , It is best to () Cover up
Such as :
#define MAX_MUM (5)
6. Function definition
● Function names are in lowercase and underlined form
● In function definition ,() Multiple local variables defined inside , When using commas , There should be a blank space after the comma
7.if while And so on :
●if、while You should leave a blank space and add parentheses ;
● The things inside the parentheses should be close to the parentheses , Such as :
if (a <= 1)
You can't if( a <= 1 )
● Curly braces should own a line
●if What's in braces , Empty four or click TAB Key rewriting
● Block and block , Between functions , There is only one blank line
● Function definition even if invisible parameters , Better add void
Such as :
int swap(void)
{
}
attach B Station reference video :
https://www.bilibili.com/video/BV1Te411474Q?share_source=copy_web
边栏推荐
- LeetCode 57. Insert interval
- AcWing 785. 快速排序(模板)
- Tag paste operator (#)
- Introduction to the usage of getopts in shell
- 【点云处理之论文狂读经典版9】—— Pointwise Convolutional Neural Networks
- LeetCode 513. 找树左下角的值
- Tree DP acwing 285 A dance without a boss
- 网络安全必会的基础知识
- Wonderful review | i/o extended 2022 activity dry goods sharing
- 【点云处理之论文狂读前沿版9】—Advanced Feature Learning on Point Clouds using Multi-resolution Features and Learni
猜你喜欢

On a un nom en commun, maître XX.

Character pyramid

too many open files解决方案

dried food! What problems will the intelligent management of retail industry encounter? It is enough to understand this article
![[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation](/img/62/edb888200e3743b03e5b39d94758f8.png)
[point cloud processing paper crazy reading classic version 12] - foldingnet: point cloud auto encoder via deep grid deformation
![[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points](/img/c1/045ca010b212376dc3e5532d25c654.png)
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points

【点云处理之论文狂读前沿版8】—— Pointview-GCN: 3D Shape Classification With Multi-View Point Clouds

一个优秀速开发框架是什么样的?

Too many open files solution

【点云处理之论文狂读前沿版13】—— GAPNet: Graph Attention based Point Neural Network for Exploiting Local Feature
随机推荐
[point cloud processing paper crazy reading classic version 10] - pointcnn: revolution on x-transformed points
【点云处理之论文狂读经典版12】—— FoldingNet: Point Cloud Auto-encoder via Deep Grid Deformation
[point cloud processing paper crazy reading classic version 9] - pointwise revolutionary neural networks
createjs easeljs
[point cloud processing paper crazy reading classic version 7] - dynamic edge conditioned filters in revolutionary neural networks on Graphs
Too many open files solution
Gaussian elimination acwing 883 Gauss elimination for solving linear equations
Save the drama shortage, programmers' favorite high-score American drama TOP10
What is an excellent fast development framework like?
We have a common name, XX Gong
Shell script kills the process according to the port number
[point cloud processing paper crazy reading frontier version 8] - pointview gcn: 3D shape classification with multi view point clouds
Use of sort command in shell
Find the combination number acwing 885 Find the combination number I
Tag paste operator (#)
Debug debugging - Visual Studio 2022
<, < <,>, > > Introduction in shell
excel一小时不如JNPF表单3分钟,这样做报表,领导都得点赞!
状态压缩DP AcWing 91. 最短Hamilton路径
AcWing 788. 逆序对的数量