2

間に違いはありますか:

procedure InequalityMsg(ABool1, ABool2 : Boolean);
begin
  if ABool1 <> ABool2 then
    ShowMessage('Yeah, they''re not the same');
end;

procedure InequalityMsg(ABool1, ABool2 : Boolean);
begin
  if ABool1 XOR ABool2 then
    ShowMessage('Yeah, they''re not the same');
end;
4

1 に答える 1

8

いいえ、まったく同じです。(まあ、生成されたコードは異なるかもしれませんが、動作に違いはありません。そして、パフォーマンスが進むにつれて、この質問は非常に重要ではありません。)

于 2011-01-27T23:21:00.370 に答える