Mau*_*rus 3 c++ coding-style indentation
我正在学习C++.对我来说,我的编程风格看起来最好; 它似乎没有遵循任何一种特定风格的规则.这是一个例子
void f(int x){ //no space between close-paren and bracket
if (!x){
cout << "x is non-zero\n";
} //closing bracket indented to the same level as the original statement
}
Run Code Online (Sandbox Code Playgroud)
对于像类或命名空间这样的东西,它只是略有不同:
class myClass {}; //space between class name and bracket, otherwise the same as functions
Run Code Online (Sandbox Code Playgroud)
K&R风格确实使用了那种包围语句,但我的风格将它用于一切.我想知道它是否有一个名称,所以我可以简单地说出我的缩进样式,而不必使用这些例子来解释.
| 归档时间: |
|
| 查看次数: |
1186 次 |
| 最近记录: |