目前我这样声明的所有变量: declare
x int;
y int;
z int;
begin
...
end
是否有可能宣布x,y和z(具有相同类型)像一条线: declare
x, y, z int;
begin
...
end
我还没有在目前为止找到the documentation的任何提示...
有时候为了清晰起见,我在代码中声明了“一次使用”变量。这是否会显着影响性能或者编译器是否可以优化它? 例如,我会倾向于做: int minVal = long_arithmetic_expresion();
int maxVal = even_longer_expression();
for (int i = minVal; i < maxVal; i++)
{
//
我想知道一次声明变量(在If-then-else循环之外)或多次(在每种情况下)之间有什么区别: 第一种情况下(我使用这种方式): If A < 0 Then
Dim YNC As MsgBoxResult = MsgBox("Select Yes-No-Cancel", vbYesNoCancel, "Select")
'Some code
ElseIf A = 0 The