Beginning C question.

Wally "The Whale" Sze wsze at nunki.usc.edu
Tue Jul 24 13:14:32 AEST 1990


I have a (beginning C) problem with a program I am working on. My
compiler uses 16-bit ints, and I need to read some 32bit long ints
from disk. 

(as a background, I wrote the same program for unix, and it worked
fine when I used getw(), but on my home compiler it doesn't.. getw()
returns only 16 bits).

A way I can see to solve this is to read two ints from disk and
concantenate them. But how do you concantenate ints? Say I have
a = 0x20df and b = 0x3244, and want to get a long int 0x20df3244.
If anyone can help, or if you can think of a better way to do this,
please let me know by mail. Thank you.



More information about the Comp.lang.c mailing list