在C#中,^字符有什么作用? [英] In c# what does the ^ character do?

查看:60
本文介绍了在C#中,^字符有什么作用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

可能重复:
>是什么?和^运算符用于?

在c#中,^字符是做什么用的?

In c# what does the ^ character do?

推荐答案

这是二进制文件 XOR 运算符.

This is binary XOR operator.

二进制^运算符已预定义用于整数类型和布尔值.为了整数类型,^按位计算其操作数的异或.对于布尔操作数,^计算逻辑其操作数的异或;那是,当且仅当结果为真确切地说,它的一个操作数是真实的.

Binary ^ operators are predefined for the integral types and bool. For integral types, ^ computes the bitwise exclusive-OR of its operands. For bool operands, ^ computes the logical exclusive-or of its operands; that is, the result is true if and only if exactly one of its operands is true.

这篇关于在C#中,^字符有什么作用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆