gpt4 book ai didi

Delphi: boolean 值的 XOR vs <>

转载 作者:行者123 更新时间:2023-12-03 18:15:21 25 4
gpt4 key购买 nike

有什么区别:

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;

最佳答案

不,它们完全一样。 (好吧,生成的代码可能不同,但行为永远不会显示任何差异。而且,随着性能的提高,这个问题非常不重要。)

关于Delphi: boolean 值的 XOR vs <>,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4823082/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com