GetByte(int x,int n) [英] GetByte(int x, int n)

查看:423
本文介绍了GetByte(int x,int n)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

GetByte(x,3)应该返回32位整数x的第3个字节。允许

运营商:! 〜& ^ | +<< >> (没有任务!)。


最简单的方法就是创建4位掩码......并使用

x& bitmask?


还有其他想法吗?

GetByte(x, 3) should return the 3rd byte of the 32 bit integer x. Allowed
operators: ! ~ & ^ | + << >> (no assignment!).

Would the easiest way to do this be just creating 4 bit masks... and using
x&bitmask ?

Any other ideas?

推荐答案



" Floyd" ; < JA ********* @ gmail.com>在消息中写道

news:f0 ****************************** @ localhost.ta lkaboutprogramming。 com ...

"Floyd" <ja*********@gmail.com> wrote in message
news:f0******************************@localhost.ta lkaboutprogramming.com...
GetByte(x,3)应该返回32位整数x的第3个字节。允许运营商:! 〜& ^ | +<< >> (没有作业!)。

最简单的方法就是创建4位掩码......并使用
x& bitmask?

任何其他想法?
GetByte(x, 3) should return the 3rd byte of the 32 bit integer x. Allowed
operators: ! ~ & ^ | + << >> (no assignment!).

Would the easiest way to do this be just creating 4 bit masks... and using
x&bitmask ?

Any other ideas?




还有其他几个。

但是,这个小组不做家庭作业!!

发布您尝试过的解决方案。我们可以评论和建议不同的

其他方法。


- Ravi



There are a couple of others.
But, this group doesnt do home works !!
Post the solution that you have tried. We can comment and suggest different
other approaches.

- Ravi


Floyd写道:
GetByte(x,3)应该返回32位整数x的第3个字节。
允许的运算符:! 〜& ^ | +<< >> (没有作业!)。

最简单的方法是创建4位掩码......还是使用x& bitmask?

任何其他想法?
GetByte(x, 3) should return the 3rd byte of the 32 bit integer x.
Allowed operators: ! ~ & ^ | + << >> (no assignment!).

Would the easiest way to do this be just creating 4 bit masks... and
using x&bitmask ?

Any other ideas?




使用资源是一回事,要求你的硬件问题的答案

直接是另一个。


是的,我跟不上这个新闻组。


-

Jason Whitehurst

<您的> cs2110 Head TA ;-)



Using resources is one thing, asking for the answer to your HW question
straight out is another.

Yes, I keep up with this newsgroup.

--
Jason Whitehurst
<your> cs2110 Head TA ;-)


" Jason Whitehurst" < JA ****** @ cc.gatech.edu>写道:
"Jason Whitehurst" <ja******@cc.gatech.edu> writes:
Floyd写道:
GetByte(x,3)应该返回32位整数x的第3个字节。
允许的运算符:! 〜& ^ | +<< >> (没有作业!)。

最简单的方法是创建4位掩码......还是使用x& bitmask?

任何其他想法?
GetByte(x, 3) should return the 3rd byte of the 32 bit integer x.
Allowed operators: ! ~ & ^ | + << >> (no assignment!).

Would the easiest way to do this be just creating 4 bit masks... and
using x&bitmask ?

Any other ideas?



使用资源是一回事,要求你的硬件问题的答案
直接是另一个。

是的,我跟上与这个新闻组。

- 杰森怀特赫斯特
<你的> cs2110主持TA; - )



Using resources is one thing, asking for the answer to your HW question
straight out is another.

Yes, I keep up with this newsgroup.

--
Jason Whitehurst
<your> cs2110 Head TA ;-)




在荷马辛普森不朽的话语中:


D''哦!愚蠢的诗意正义!


-

Keith Thompson(The_Other_Keith) ks***@mib.org < http://www.ghoti.net/~kst>

圣地亚哥超级计算机中心< *> < http://users.sdsc.edu/~kst>

我们必须做点什么。这是事情。因此,我们必须这样做。



In the immortal words of Homer Simpson:

"D''oh! Stupid poetic justice!"

--
Keith Thompson (The_Other_Keith) ks***@mib.org <http://www.ghoti.net/~kst>
San Diego Supercomputer Center <*> <http://users.sdsc.edu/~kst>
We must do something. This is something. Therefore, we must do this.


这篇关于GetByte(int x,int n)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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