• Post Reply Bookmark Topic Watch Topic
  • New Topic

hiword, loword, hibyte, lobyte...  RSS feed

 
john s murray
Ranch Hand
Posts: 30
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Is there something like getLoByte, getHiWord, etc.. that I can use to get the following C++ equivelent?
HIWORD, LOWORD, HIBYTE, and LOBYTE

Let's say i have a int, how would i get the hiword(int), then get the hibyte of the value of the hiword(int)?

thanks in advance.
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 66304
152
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Please take the time to choose the correct forum for your posts. This forum is for questions on Servlets.

For more information, please read this.

This post has been moved to a more appropriate forum.

 
Henry Wong
author
Sheriff
Posts: 23295
125
C++ Chrome Eclipse IDE Firefox Browser Java jQuery Linux VI Editor Windows
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator

The easiest way is probably to use a combination of the shift and AND operators. However, if you are not comfortable with those operators, you can also use the java.nio.ByteBuffer class.

Henry
 
Campbell Ritchie
Marshal
Posts: 56522
172
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Too difficult a question for use beginners. Moving.

Whether the use of the actual contents of a memory location is consistent with use of a high-level language is a moot point.
 
Consider Paul's rocket mass heater.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!