Re: Problems with write_to_output and buf (sprintf)

From: Mathew Earle Reuther (
Date: 07/31/02

On Tue, 30 Jul 2002, Daniel A. Koepke wrote:
> The bug: you're appending the text to the existing buffer in these

First I fixed that.  It worked wonderfully once I stopped appending.  Duh.

> The real proble: the entire function needs to be rewritten.  There are

That I knew, I just didn't have any clue HOW to do it, so I went with what
I thought I could handle (though even then as we can see I didn't quite
master it.) :)

>   bool class_ok_by_supercategory[NUM_CATEGORIES][NUM_CLASSES] = {

Question on bool, since I don't have any c99 reference stuff handy: Is it
simply a 1 or 0 return?  Should I convert anything that is using int for a
yes/no or true/false to bool instead?

> There's nothing preventing you from reproducing the desired format while
> still using a for loop.

Other than my own lack of skill that is! :)  Thanks a lot for this
function, I'm trying to see what it's doing with the various checks as I
suspect it's very useful for me to learn how to p[roperly loop in the
future.  Saves a LOT of lines of code.


(p.s. I'm having problems getting it to actually compile.  Keeps telling
me I have multiple definitions of the const char . . . I'll keep working
on it though.)

   | FAQ: |
   | Archives: |
   | Newbie List:   |

This archive was generated by hypermail 2b30 : 06/25/03 PDT