[wplug] C code problem

Matthew Danish mdanish at andrew.cmu.edu
Wed Oct 23 19:19:18 EDT 2002


On Wed, Oct 23, 2002 at 05:22:36PM -0400, Henry Umansky wrote:
> I've tried long too and it still does the same thing, I think it has 
> something to do with the output buffering. Has anyone tried to run it?? 
> For the most part the values are the same, but every now and then the first 
> value is 100,000 more than the second.  Another thing I noticed is that it 
> always happens on the same numbers.

Well, it does seem that your problem in particular was due to buffering.
However, on Linux systems the ``int'' type is the same size as the
``long'' type (32 bits), and both are too small to hold 100 billion.
GCC gave me a warning about this (gcc version 2.95.4 20011002).  I
wasn't quite sure what your problem was, so I just noted this as being
possibly-undefined behavior.

Anyway, if you want fancier output options than \r, you should look into
using ncurses.

-- 
; Matthew Danish <mdanish at andrew.cmu.edu>
; OpenPGP public key: C24B6010 on keyring.debian.org
; Signed or encrypted mail welcome.
; "There is no dark side of the moon really; matter of fact, it's all dark."



More information about the wplug mailing list