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 回答