各种编程语言的注释符
来源:互联网 发布:mac破解版软件下载 编辑:程序博客网 时间:2024/05/16 06:23
常见语言:
c
行注释:none
块注释:
扩展名:.c/.h
c++
行注释://这里是注释
块注释:
扩展名:.cpp/.h
c#
行注释://这里是注释
块注释:
xml注释:///这里是xml注释
扩展名:.cs
行注释:'这里是注释
块注释:none
扩展名:.bas
java
行注释://这里是注释
块注释:
扩展名:.java
vb.net
行注释:'这里是注释
块注释:none
xml注释:///这里是xml注释
扩展名:.vb
perl
行注释:#这里是注释
块注释:none
扩展名:.pm
html
行注释:none
块注释:<!--这里是注释-->
扩展名:.htm/.html
SQL
行注释:--
块注释:
Comment comparison
There is a wide variety of syntax styles for declaring comments in source code. BlockComment
in italics is used here to indicate block comment style. InlineComment
in italics is used here to indicate inline comment style.
-- InlineComment
ALGOL 60 comment BlockComment;
ALGOL 68 ¢ BlockComment ¢
comment BlockComment comment
co BlockComment co
# BlockComment #
£ BlockComment £
-- InlineComment
(* BlockComment *)
Assembly language (varies); InlineComment
one example (most assembly languages use line comments only) AutoHotkey; InlineComment
/* BlockComment */
AWK, Bash, Bourne shell, C shell, Maple, Python, R, Tcl, and Windows PowerShell# InlineComment
<# BlockComment #>
BASIC (various dialects):'InlineComment
(not all dialects)REM InlineComment
/* BlockComment */
C (C99), C++, Go, and JavaScript// InlineComment
/* BlockComment */
C#// InlineComment
/// InlineComment
(XML documentation comment)/* BlockComment */
/** BlockComment */
(XML documentation comment)CobolInlineComment
(when * is in column 7) Curl|| InlineComment
|# BlockComment #|
|foo# BlockComment #|
# InlineComment
/# BlockComment #/
(nestable)D// InlineComment
/// Documentation InlineComment
(ddoc comments)/* BlockComment */
/** Documentation BlockComment */
(ddoc comments)/+ BlockComment +/
(nestable)/++ Documentation BlockComment +/
(nestable, ddoc comments)
$! InlineComment
ECMAScript (JavaScript, ActionScript, etc.)// InlineComment
/* BlockComment */
Forth\ InlineComment
( BlockComment )
(single line only)( before -- after )
stack comment convention
C InlineComment
(the letter 'C' in the first column makes the entire line a comment). Fortran 90! InlineComment
(all characters on the line, from the exclamation mark onwards, are comments) Haskell-- InlineComment
{- BlockComment -}
Java// InlineComment
/* BlockComment */
/** BlockComment */
(Javadoc documentation comment)
; InlineComment
#| BlockComment |#
Lua-- InlineComment
--[==[ BlockComment]==]
(variable number of = signs)Maple# InlineComment
(* BlockComment *)
Mathematica % (* BlockComment *)
Matlab% InlineComment
%{
BlockComment (nestable)
%}
Note: Both percent–bracket symbols must be the only non-whitespace characters on their respective lines.Object Pascal (Delphi)
// InlineComment
(* BlockComment *)
{ BlockComment }
OCaml (* BlockComment (* nestable *) *)
Pascal, Modula-2, Modula-3, Oberon, and ML: (* BlockComment *)
(OCaml comments are nestable)Perl and Ruby# InlineComment
=begin
BlockComment
=cut
(POD documentation comment)__END__
Comments after end of code
# InlineComment
// InlineComment
/* BlockComment */
/** Documentation BlockComment */
(PHP Doc comments)PILOTR:InlineComment
PL/SQL and TSQL-- InlineComment
/* BlockComment */
REALbasic' InlineComment
// InlineComment
rem InlineComment
SAS * BlockComment;
/* BlockComment */
Seed7# InlineComment
(* BlockComment *)
Simula comment BlockComment;
! BlockComment;
Smalltalk "BlockComment"
Smarty {* BlockComment *}
Standard ML (* BlockComment *)
TeX, LaTeX, PostScript, Erlang, and S-Lang% InlineComment
Texinfo@c InlineComment
@comment InlineComment
* InlineComment
command $$ InlineComment
Visual Basic' InlineComment
Rem InlineComment
Visual Basic .NET' InlineComment
''' InlineComment
(XML documentation comment)Rem InlineComment
% InlineComment
/* BlockComment */
参考推荐:
Comparison of programming languages (syntax) (wiki)
- 各种编程语言的注释符
- 详解各种编程语言的注释符
- [杂记]各种编程语言的注释
- 各种编程语言的注释形式
- PHP注释以及各种语言的注释
- PHP注释及各种语言的注释
- 各种语言中的注释符
- 各种编程语言的介绍
- 各种编程语言的特点
- 各种编程语言的介绍
- 编程语言的各种分类
- 各种语言注释标注总结
- 【编程趣事】各种让人哭笑不能的代码注释
- 编程语言 - 注释
- 各种数据库的注释
- 各种编程语言的Hello world程序
- 各种编程语言的”HelloWorld!”程序
- 点评我接触的各种编程语言
- C#程序设计(六)----求字符串中的大写字母、小写字母和其他字母
- c#DevExpress组件TreeList控件自己控制节点图标(二)
- Apache、MySQL、PHP
- Android webView中无法显示Twitter主页
- Jedec China简介
- 各种编程语言的注释符
- 如果你想写自己的编译器...
- iOS的runtime
- c#DevExpress组件TreeList控件自己控制节点图标(一)
- linux下的C函数(持续更新中)
- UITableViewCell 可重用单元cell清除subViews
- Linux free -m 详细说明
- 25个必须记住的SSH命令
- 异步读写文件