注释-C++

前语

这是我学C++的笔记,如果对你有帮助,你可以复制下来ouo。

正片

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
#include <iostream>
using namespace std;
/**
*
* 多行注释
*
*/
// 单行注释
int a;
int b = 30;

int main(){

a = 20;

int c;
c = 40;
int d = 50;

cout << a << endl;
cout << b << endl;
cout << c << endl;
cout << d << endl;

return 0;
}

可以看到有 多行注释 和 单行注释

多行注释

1
2
3
4
/** s请在此处回车 */
/**
* 就会得到这个
*/

写的时候在s处回车就行

单行注释

1
// 没错,就是这么简单

单行注释就两个 / 而已