Path: utzoo!utgpu!news-server.csri.toronto.edu!rpi!usc!wuarchive!cs.utexas.edu!beach!mrimages From: mrimages@beach.gal.utexas.edu Newsgroups: comp.sys.amiga.programmer Subject: Re: 4 bytes to a long? Message-ID: <452.28524fa9@beach.gal.utexas.edu> Date: 9 Jun 91 21:56:24 GMT References: <451.28517f01@beach.gal.utexas.edu> Lines: 31 Sorry, to be less ambiguous I am including some lines that were left out of my original source example: In article <451.28517f01@beach.gal.utexas.edu>, mrimages@beach.gal.utexas.edu writes: > > Is there a fast, simple way to convert 4 bytes into a long? I am > doing it presently this way, but it seems kind of kludgy: union { long tlong; char tchar[4]; } mytime; char block[232]; for(i=0;i<4;i++) mytime.tchar[i]=block[123+i]; sprintf(tempstr,"%s",ctime(&mytime.tlong)); > Any suggestions or is this the best I can do? I am not really concerned about Big_endian/Little_endian differences. This is an Amiga specific program. Thanks to all who have replied VIA mail to date to this question and also to my begin 644 FILENAME query. --- "If all you have is a hammer, please return it to the record store." R. Luebbert = mrimages@beach.gal.utexas.edu (UT Medical Branch Galveston)