delorie.com/archives/browse.cgi   search  
Mail Archives: djgpp/2004/12/18/19:12:40

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 <dj AT delorie DOT com>
To: djgpp AT delorie DOT com
In-reply-to: <el89s0hcav344jvuh265q8r28616ifusj8@4ax.com> (message from
Radical NetSurfer on Sat, 18 Dec 2004 16:49:09 -0500)
Subject: Re: Tips & Tricks (long forgotten)
References: <el89s0hcav344jvuh265q8r28616ifusj8 AT 4ax DOT com>
Errors-To: nobody AT delorie DOT com
X-Mailing-List: djgpp AT delorie DOT com
X-Unsubscribes-To: listserv AT delorie DOT com

> 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.

- Raw text -


  webmaster     delorie software   privacy  
  Copyright © 2019   by DJ Delorie     Updated Jul 2019