• Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
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.
 
Author and ninkuma
Marshal
Posts: 66541
160
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.

 
author
Marshal
Posts: 23440
138
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
 
Marshal
Posts: 58454
178
  • 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.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!