> For the complete documentation index, see [llms.txt](https://huataihuang.gitbook.io/cloud-atlas-draft/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://huataihuang.gitbook.io/cloud-atlas-draft/develop/c/compile/single_comment_and_multi_comment_in_c.md).

# c语言中的单行注释和多行注释方法

在C语言中，单行注释使用 `//` ，多行注释使用 `/* */`，还有一种巧妙的方法是使用`#if 0 #endif`这样的代码裁剪方法：

```c
// 这是单行注释

/* 这是多行注释
在这个范围内都是注释
*/

int a,b;

#if 0
其实这里也是多行注释
在这个范围内都是注释
#endif
```
