为什么在if块之后立即得到这种行为?我想念什么吗?
for (;;)
if (/*...*/)
{
// statements
}
// statements indented to match the if indentation instead of the for loop;
最佳答案
保持VS合理缩进的唯一方法是,始终使用块来封装由for
,if
,while
等控制的语句。在您的情况下,这意味着:
for (;;)
{
if (/* ... */)
{
// ...
}
}
// further statements here indented to match for loop.
关于c++ - for循环后的Visual Studio 2010缩进,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/3105857/