Re: Java to C Structure Communication
Jeff Kesselman <[email protected]> Thu, 7 Feb 2008 13:01:33 -0500
| Newsgroups | gmane.comp.windows.devel.java.advanced |
|---|---|
| Message-ID | <[email protected]> |
Patrick Schneider wrote: > I was under the impression that Java integral types are signed > two's-complement integers... > > What did you mean by this: > > >> Java int is an unsigned 32 bit number. >> > > ? ... or am I missing something? > Nope your right, brain fart. All Java ints are signed. So to do an unsigned, you need to go to a bigger type. If its already a 32 bit number, I guess youll need to read it as bytes and assemble it as a BigInt. Or give uup on the high bit if your sure the numerbs never really get that high. Thats what I did for my NWN data loader, just truncated the unsigned to 31 bits. JK -- ======================================================================= Journalism 101: The difference between news and a press release News tells you what the reporter thinks is true. A press release tells you what a company wants *you* to think is true. Only bad reporters think the two are the same. =================================== This list is hosted by DevelopMentor® http://www.develop.com View archives and manage your subscription(s) at http://discuss.develop.com