C++程序编写注释规范
C++程序编写注释规范
文件起始处说明
在.h/.cpp文件的开头应该有一段格式统一的说明,内容包括:
- 文件名(Filename)
- 创建人(Creator)
- 文件创建日期(Date)
- 简短说明文件功能、用途(Comment)
例如:
/*****************************************************************************
* xxx xxx Co., Ltd *
* Copyright (C) 2014 xxx xxx *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License version 3 as *
* published by the Free Software Foundation. *
* *
* You should have received a copy of the GNU General Public License *
* along with OST. If not, see <http://www.gnu.org/licenses/>. *
* *
* Unless required by applicable law or agreed to in writing, software *
* distributed under the License is distributed on an "AS IS" BASIS, *
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, *
* either express or implied. *
* See the License for the specific language governing permissions and *
* limitations under the License. *
* *
* @file Example.h *
* @brief 对文件的简述 *
* Details.