你如何在C#中返回'不是UINT“? [英] How do you return 'not uint' in C#?

查看:206
本文介绍了你如何在C#中返回'不是UINT“?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我用VB写的一些代码,内容如下:

I have some code written in VB that reads as follows:

Return (Not (crc32Result))

我想将其转换为C#,这是我有:

I am trying to convert it to C#, and this is what I have:

return (!(crc32Result));



不过,我得到一个编译错误:

However I get a compiler error:

编译器错误信息: CS0023:'!'操作符不能应用于类型为UINT

Compiler Error Message: CS0023: Operator '!' cannot be applied to operand of type 'uint'

是否有不同的运营商,我需要使用这一个呢?

Is there a different operator I need to be using instead of this one?

谢谢!

推荐答案

它看起来像你正在尝试做的是扭转crc32result的位。如果是这样,你想要的波浪符〜

It looks like what you are trying to do is reverse the bits of crc32result. If so, you want the tilde operator ~.

return (~crc32Result);



参考的这个问题。

这篇关于你如何在C#中返回'不是UINT“?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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