我应该在哪里提交文件评论?

编程入门 行业动态 更新时间:2024-10-18 18:22:28
本文介绍了我应该在哪里提交文件评论?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧! 问题描述

/

在包含转发声明的头文件中,或包含实现的.cpp文件, /header.h / *关于foo()* / void foo(); / *关于bar()* / int bar(); / *关于A * / 类A { public: / *关于A的构造函数* / A(); .... }

// implementation.cpp / *关于foo()* / void foo() { ... ... } / *关于酒吧* / int bar() { ... } / *关于A的构造函数* / A :: A() { ... }

解决方案

对于使用信息,放入标题更好。这是人们首先看的地方。

如果没有人必须检查您的.cpp文件来确定应该如何使用组件,那么文档是非常成功的。 >

In the header file containing the forward declarations, or in the .cpp file containing the implementations, like this?

//header.h /* About foo() */ void foo(); /* About bar() */ int bar(); /* About A */ class A { public: /* About A's constructor */ A(); .... }

Or

//implementation.cpp /* About foo() */ void foo() { ... ... } /* About bar */ int bar() { ... } /* About A's constructor */ A::A() { ... }

解决方案

For usage information, it's nicer to put into the header. That's where people would look first.

The documentation is really successful if no one has to examine your .cpp file to figure out how the component should be used.

更多推荐

我应该在哪里提交文件评论?

本文发布于:2023-11-14 00:26:08,感谢您对本站的认可!
本文链接:https://www.elefans.com/category/jswz/34/1585714.html
版权声明:本站内容均来自互联网,仅供演示用,请勿用于商业和其他非法用途。如果侵犯了您的权益请与我们联系,我们将在24小时内删除。
本文标签:文件

发布评论

评论列表 (有 0 条评论)
草根站长

>www.elefans.com

编程频道|电子爱好者 - 技术资讯及电子产品介绍!