[Sussex] Re: C programming help - again!

Mike Diack mike_diack at hotmail.com
Wed May 11 07:33:58 UTC 2005


What's worth noticing is that the "Hello World!\n\n\n" string you are trying
to copy is longer than the 13 bytes you are
asking strncpy to copy. Is this intentional? Do remember that '\0'
terminates a 'c' string (i.e. a char * type string), not a '\n'.
Mike

-----Original Message-----
From: sussex-bounces at mailman.lug.org.uk
[mailto:sussex-bounces at mailman.lug.org.uk] On Behalf Of Steve Dobson
Sent: 10 May 2005 20:18
To: LUG email list for the Sussex Counties
Subject: Re: [Sussex] Re: C programming help - again!

Captain

On Tue, May 10, 2005 at 06:52:14PM +0100, Captain Redbeard wrote:
> BTW Steve, you were right when you bet I was not "almost there".  My 
> program seemed to be finished and compiled without problems but it had 
> the annoying habit of that it crashed "sometimes" when it ran, not 
> consistently or in the same place so I thought that there was a 
> "slight" error somewhere that needed minor modifications to get it 
> stable.  I ran Valgrind on it to see what it would find.  The
> result: it notched up 30,000 errors and stopped counting!  Oh well, 
> back to the drawing board!

There is an old rule in software programming.  90% of the work takes 10% of
the time.  If you feel your "almost there" then you probably think you've do
90% of the work.
So now you can guestimate how long it will take to do the remaining 10%.

Steve

_______________________________________________
Sussex mailing list
Sussex at mailman.lug.org.uk
Sussex LUG Website: http://www.sussex.lug.org.uk/
http://mailman.lug.org.uk/mailman/listinfo/sussex




More information about the Sussex mailing list