Click here to Skip to main content
15,897,704 members

The Weird and The Wonderful

   

The Weird and The Wonderful forum is a place to post Coding Horrors, Worst Practices, and the occasional flash of brilliance.

We all come across code that simply boggles the mind. Lazy kludges, embarrassing mistakes, horrid workarounds and developers just not quite getting it. And then somedays we come across - or write - the truly sublime.

Post your Best, your worst, and your most interesting. But please - no programming questions . This forum is purely for amusement and discussions on code snippets. All actual programming questions will be removed.

 
GeneralRe: For loop horror Pin
CPallini5-Nov-07 23:57
mveCPallini5-Nov-07 23:57 
GeneralRe: For loop horror Pin
Lars Wadefalk8-Nov-07 1:59
Lars Wadefalk8-Nov-07 1:59 
GeneralOne-Liner Pin
Rob Grainger30-Oct-07 11:20
Rob Grainger30-Oct-07 11:20 
GeneralRe: One-Liner Pin
Blake Miller31-Oct-07 3:22
Blake Miller31-Oct-07 3:22 
GeneralRe: One-Liner Pin
Brady Kelly31-Oct-07 22:31
Brady Kelly31-Oct-07 22:31 
GeneralRe: One-Liner Pin
DavidNohejl31-Oct-07 23:03
DavidNohejl31-Oct-07 23:03 
GeneralRe: One-Liner Pin
Brady Kelly31-Oct-07 23:16
Brady Kelly31-Oct-07 23:16 
GeneralRe: One-Liner Pin
JudyL_MD1-Nov-07 3:39
JudyL_MD1-Nov-07 3:39 
It works if the current contents of the destination are smaller than the source string. It won't copy entirely if the current destination contents are less than the source, even if the buffer is physically large enough to hold the source. By using strlen, it does not use the full available length of the destination buffer. strlen versus sizeof

Judy
GeneralRe: One-Liner Pin
Blake Miller1-Nov-07 4:06
Blake Miller1-Nov-07 4:06 
GeneralRe: One-Liner [modified] Pin
hatelamers1-Nov-07 16:11
hatelamers1-Nov-07 16:11 
GeneralRe: One-Liner Pin
Steve Hansen2-Nov-07 4:44
Steve Hansen2-Nov-07 4:44 
GeneralRe: One-Liner Pin
hatelamers2-Nov-07 16:47
hatelamers2-Nov-07 16:47 
GeneralRe: One-Liner Pin
Robert Surtees1-Nov-07 4:45
Robert Surtees1-Nov-07 4:45 
GeneralRe: One-Liner Pin
James R. Twine5-Nov-07 3:58
James R. Twine5-Nov-07 3:58 
GeneralFrom where to, I dunno Pin
Brady Kelly30-Oct-07 7:31
Brady Kelly30-Oct-07 7:31 
GeneralRe: From where to, I dunno Pin
Fatbuddha 130-Oct-07 8:04
Fatbuddha 130-Oct-07 8:04 
GeneralRe: From where to, I dunno Pin
Andy Brummer30-Oct-07 10:53
sitebuilderAndy Brummer30-Oct-07 10:53 
GeneralRe: From where to, I dunno Pin
Brady Kelly30-Oct-07 11:17
Brady Kelly30-Oct-07 11:17 
GeneralRe: From where to, I dunno Pin
Phil J Pearson31-Oct-07 3:28
Phil J Pearson31-Oct-07 3:28 
AnswerRe: From where to, I dunno Pin
Chris Meech30-Oct-07 11:25
Chris Meech30-Oct-07 11:25 
GeneralRe: From where to, I dunno Pin
Brady Kelly30-Oct-07 11:36
Brady Kelly30-Oct-07 11:36 
GeneralRe: From where to, I dunno Pin
PIEBALDconsult30-Oct-07 16:45
mvePIEBALDconsult30-Oct-07 16:45 
GeneralRe: From where to, I dunno Pin
_Damian S_30-Oct-07 19:50
professional_Damian S_30-Oct-07 19:50 
GeneralRe: From where to, I dunno Pin
Luc Pattyn31-Oct-07 0:33
sitebuilderLuc Pattyn31-Oct-07 0:33 
GeneralRe: From where to, I dunno Pin
dwilliss31-Oct-07 4:26
dwilliss31-Oct-07 4:26 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.