C++ 注释
C++ 教程
· 2019-02-24 21:14:41
程序的注释是解释性语句,您可以在 C++ 代码中包含注释,这将提高源代码的可读性。所有的编程语言都允许某种形式的注释。
C++ 支持单行注释和多行注释。注释中的所有字符会被 C++ 编译器忽略。
C++ 注释以 /* 开始,以 */ 终止。例如:
/* 这是注释 */
/* C++ 注释也可以
* 跨行
*/
注释也能以 // 开始,直到行末为止。例如:
实例
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World"; // 输出 Hello World
return 0;
}
当上面的代码被编译时,编译器会忽略 // 输出 Hello World,最后会产生以下结果:
Hello World
在 /* 和 */ 注释内部,// 字符没有特殊的含义。在 // 注释内,/* 和 */ 字符也没有特殊的含义。因此,您可以在一种注释内嵌套另一种注释。例如:
/* 用于输出 Hello World 的注释
cout << "Hello World"; // 输出 Hello World
*/
点击查看所有 C++ 教程 文章: https://codercto.com/courses/l/18.html
Beginning Apache Struts
Arnold Doray / Apress / 2006-02-20 / USD 44.99
Beginning Apache Struts will provide you a working knowledge of Apache Struts 1.2. This book is ideal for you Java programmers who have some JSP familiarity, but little or no prior experience with Ser......一起来看看 《Beginning Apache Struts》 这本书的介绍吧!