03commentsincprogrammingc编程中的注释(代码片段)

xlfcjx xlfcjx     2022-12-08     751

关键词:

Comments 注释简介

技术图片

Let‘s take a quick break from programming and talk about comments.
Comments help programmers understand what exactly the computer program does.
Comments are also a short summary of your computer program.
让我们从编程中快速休息一下,来谈谈注释。
注释帮助程序员了解计算机程序的确切功能。
注释也是您的计算机程序的简短摘要。

技术图片

There are two types of comments in programming:

  • Single line comment
  • Multiline comment

It is as simple as it sounds. Single line comment is used to comment a single line and Multiline comment is used for multiple lines.
The computer ignore these lines while executing a program.

编程中有两种类型的注释:

  • 单行注释。
  • 多行注释。

这听起来很简单。单行注释用于注释单行,多行注释用于多行。计算机在执行程序时忽略这些行

Single Line Comment 单行注释

Single Line Comment
Let‘s see how to comment your command
It‘s very simple, to comment any command you just have to put ‘//" symbol at the very beginning of your command
Once you put‘//‘at the beginning, whatever command or text you write in that entire line will be ignored.
Example:
单行注释。
让我们看看如何注释您的命令行。
这非常简单,要注释任何命令,您只需在命令的开头加上‘//’符号。
一旦您在开头加上‘//’,您在整行中编写的任何命令文本都将被忽略。
示例:

int main()
  // This line prints hi
  printf("Hi");

  • Here, the comment "This line prints hi" will be ignored by the computer and it will just print ‘Hi‘ on the screen.
  • Comments are extremely useful for other people to understand your code.
  • It also helps you to remember what your code does!
  • Whenever you think commenting would help in clarifying your code, do it!
  • 在这里,“此行打印Hi”的注释将被计算机忽略,它只会在屏幕上打印“Hi”。
  • 注释对于其他人理解您的代码非常有用。
  • 它还可以帮助您记住代码的作用!
  • 每当您认为注释有助于澄清您的代码时,就去注释吧!

技术图片

What if you want the computer to ignore multiple commands written in multiple lines, like 12 commands?
It will be annoying to put ‘//‘ on each and every line, isn‘t it?
如果希望计算机忽略多行编写的多个命令,比如12行命令,该怎么办?
在每一行都加“//”会很烦人,不是吗?

Multiline Comment 多行注释

So there is a better way to comment multiple commands.
It‘s done by using ‘/‘ at the beginning of your first command and using ‘/‘ at the end of your last command.
This is called multi line comment.
Whatever you write between ‘/‘ and ‘/‘ , be it a command or any text, will be ignored by the computer.
因此,有一种更好的方法来注释多个命令。
这可以通过在第一个命令的开头使用‘/’,在最后一个命令的末尾使用‘/’来完成。
这称为多行注释。
无论您在‘/’和‘/’之间写什么,无论是命令还是任何文本,都将被计算机忽略。

Example 示例:

printf (" A ");
// printf "B");
printf (" C ");
/* printf (" D ");
print f (" E ");
printf (" F ");
*/

Here, the printf command for ‘B‘ and printf command for ‘D‘ to ‘F" will be ignored by the computer, and you will not see these command‘s texts in the
The program ‘s output.
在这里,计算机将忽略‘B’的printf命令和‘D’到‘F’的printf命令,并且您不会在程序的输出中看到这些命令的文本内容。

图片知识总结

技术图片

技术图片

技术图片

技术图片




























day-10

1,10,03:38,142,3281,10,03:40,141,3281,10,03:42,140,3281,10,03:44,139,3281,10,03:46,138,3281,10,03:48,137,3281,10,03:50,136,3281,10,03:52,135,3281,10,03:54,134,3281,10,03:56,133,3281,10,03:58,132,3281, 查看详情

fianld109

9,10,03:00,142,3289,10,03:02,141,3289,10,03:04,140,3289,10,03:06,139,3289,10,03:08,138,3289,10,03:10,137,3289,10,03:12,136,3289,10,03:14,135,3289,10,03:16,134,3289,10,03:18,133,3289,10,03:20,132,3289, 查看详情

2016/03/03codes

<!DOCTYPEhtml><html><headlang="en"><metacharset="UTF-8"><title></title><styletype="text/css">.heart{width:200px;height:200px;background-color:#d31145;margin:1 查看详情

[2016-03-03][uva][1374][powercalculus]

[2016-03-03][UVA][1374][PowerCalculus]时间:2016-03-0316:14:01星期四题目编号:UVA1374题目大意:给出x的指数n,问,x经过多少次相乘才能得到x^n输入:n输出:次数分析:求乘法的所有可能方式,用dfs,适当剪枝优化,变成IDA*x的乘法,变成了指数的加法每次... 查看详情

js-03课-03加减算法

<!DOCTYPEhtml><html><headlang="en"><metacharset="UTF-8"><title></title></head><body><script>//fn1(1,2,3,5);functionfn1(){alert(arguments)//objecta 查看详情

js-03课-03js中的真假判断

真假的问题:数据类型-数字(NaN)、字符串、布尔、函数、对象(elem、[]、{}、null)、未定义 真:非0的数字、非空字符串、true、函数、能找到的元素、[]、{} 假:0、NaN、空字符串‘‘、false、不能找到的元素、null、未定义 ... 查看详情

学习记录(2022年3月份记录)(代码片段)

目录2022_03_02:一些C语言需要注意的知识2022_03_032022_03_042022_03_072022_03_082022_03_102022_03_14:_findfirst()2022_03_162022_03_21:转换FILETIME2022_03_232022_03_242022_03_25 :注册服务时注册成功但是 查看详情

htmlif_03_03_basic_button(代码片段)

查看详情

sql调优带您涨薪资-explian分析sql执行计划并优化(代码片段)

...-explian分析SQL执行计划并优化01前期准备02explain字段含义03分析SQL的执行计划瓶颈的关键项:03::01id03::02select_type03::03type(分析性能瓶颈的关键项之一)03::03::01【all】:遍历全表03::03::02【index】:索引全扫描03::03::03【range】:索引范围扫描... 查看详情

无法将日期时间从字符串转换为另一种格式(例如:14/12/2021 03:34:03 PM 到 03:34 pm)

...将日期时间从字符串转换为另一种格式(例如:14/12/202103:34:03PM到03:34pm)【英文标题】:Can\'tconvertaDatetimefromastringtoanotherformat(eg:14/12/202103:34:03PMto03:34pm)【发布时间】:2022-01-1716:43:15【问题描述】:我正在尝试将日期时间字符串... 查看详情

table

...utton></head> <body><script>varweekStart=‘2019-03-17‘varweekEnd=‘2019-03-23‘functiontableToExcel()//要导出的json数据constjsonData=[SD:‘2019-03-1700:00‘,ED:‘2019-03-1717:00‘,TI:‘今天天气真好‘,SD:‘2019-03-1801:00‘,ED:‘2019-03-1817:00‘,T... 查看详情

03-03:springboot整合thymeleaf

thymeleaf语法详解1.变量输出: th:text:在页面中输出某个值 th:value:将一个值放到input标签中的value中。2.判断字符串是否为空 ①:调用内置对象一定要用# ②:大部分的内置对象都已s结尾(strings,numbers,dates) ${... 查看详情

SCP03 外部认证

】SCP03外部认证【英文标题】:SCP03ExternalAuthenticate【发布时间】:2020-01-1716:28:03【问题描述】:我正在尝试使用SCP03在eUICC上进行相互身份验证。当我向卡发送外部身份验证命令时,我收到了它的响应:AF8023026985,我相信SW=6985。... 查看详情

2017/03/03学习笔记

链表单向链表 非常常用的一种数据结构对于数组,逻辑关系上相邻的两个元素的物理位置也是相邻的,这种结构的优点是随机存储任意位置的元素,但缺点是如果从数组中间删除或插入元素的时候,需要大量的移动元素,效... 查看详情

如何更改bootstrapnavbar的颜色03社区03rubychina

参考技术A到bootstrap的官网定制自己的风格,http://getbootstrap.com/customize/使用基于bootstrap的主题,这里有个站点有一些bootstrap的免费主题http://bootswatch.com/我是基于bootstrap3作答的,2.x也是差不多的 查看详情

volley介绍03

------------------------------------------------------------------------------转载:http://blog.csdn.net/crazy__chen/article/details/46486123-------------------------------------------------------------- 查看详情

03day03misc_device

1#include<linux/module.h>//MODULE_LICENSE("GPL");2#include<linux/init.h>//module_initmodule_exit3#include<linux/kernel.h>//printk4#include<linux/io.h>//ioremapiounremap5#includ 查看详情

javascript总结03

             查看详情