X-Authentication-Warning: delorie.com: mail set sender to djgpp-bounces using -f Date: Sat, 18 Dec 2004 19:12:14 -0500 Message-Id: <200412190012.iBJ0CE04016994@envy.delorie.com> From: DJ Delorie To: djgpp AT delorie DOT com In-reply-to: (message from Radical NetSurfer on Sat, 18 Dec 2004 16:49:09 -0500) Subject: Re: Tips & Tricks (long forgotten) References: Errors-To: nobody AT delorie DOT com X-Mailing-List: djgpp AT delorie DOT com X-Unsubscribes-To: listserv AT delorie DOT com Precedence: bulk > Did you know that > _lfn_gen_short_fname > does *not* actually return the true Windows Short Filename? Proof? What does it return, then? > Truncating a string with printf() Does anyone know if such a thing > is possible? Of course it is, if you read the directions. > Using %-12s has no effect if the string is long; Neither does using %d. Try using %.12s instead. > Binary_Blocks_of_Data: What I'd also like to see is a tutorial on > copying, concatenating, and searching Binary-Blocks of Data... Nothing in C provides a "block of data" type. Files are either text, organized into lines, or raw binary data, not organized at all. If you want to apply some structure to the data, that's entirely up to you. Neither C nor DJGPP has anything to do with it, aside from providing the tools to get and put binary data from/to the file. > on the fly... a function like memcat(), would be nice Most programmers just keep the location in a separate variable, often using a struct type to keep track of all the variables relating to a block of data. This is not DJGPP specific, though. Any C tutorial (try your local bookstore) should be able to teach you this.