是的,你看到的没有任何中文字。笔者不推荐写注释使用中文,一是不国际化,二是目前还存在不支持中文的编译器,三是不利于代码的移植(平台对中文的支持程度不同,会造成显示乱码等)。所以程序员还是老老实实的用英文写注释吧,而且还能增强自己的英文水平。一举多得,何乐而不为。
下面是我给大家举的几个注释的例子:
1.文件头注释
/* *****************************************************************
* @File Name : Main.c
* @Copyright (C/C++)
* @Author : Bernie Liu
* @DATE : 2014-02-21
* @Brief : marquee(horse race lamp)
* @Details : User can set the rate and the direction;Key1 set
the rate,Key2 set the direction
* @Version : V0.01
* @Target : C8051F005
* @ToolChain : Keil4
* @Notes :
*****************************************************************
*/
这个注释是比较简单的,在 @Details一栏并没有详细的讲述此文件所做的工作,程序员在注释文件头的时候可以比较详细的叙述此文件所能完成的功能
2.函数注释
/*
****************************************************************
* @Function Name : UserSetMarqueeRates
* @Brief : User set the Marquee's rates
* @Details : rates include 8 modes, 0~8
* @Param[in] : 1)BYTE rates,User set from Key1 tunner