Click here to Skip to main content
15,889,931 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: Helpful comment Pin
elchupathingy7-May-10 4:10
elchupathingy7-May-10 4:10 
GeneralRe: Helpful comment Pin
Christopher Ayroso10-May-10 19:23
Christopher Ayroso10-May-10 19:23 
GeneralExcellent usage Of ComapareTo+Equals methods!! Pin
Dan Mos2-May-10 14:46
Dan Mos2-May-10 14:46 
GeneralSQL Zoolander Trimming PinPopular
AspDotNetDev23-Apr-10 14:36
protectorAspDotNetDev23-Apr-10 14:36 
GeneralRe: SQL Zoolander Trimming Pin
PIEBALDconsult24-Apr-10 6:00
mvePIEBALDconsult24-Apr-10 6:00 
GeneralRe: SQL Zoolander Trimming Pin
AspDotNetDev24-Apr-10 8:58
protectorAspDotNetDev24-Apr-10 8:58 
GeneralRe: SQL Zoolander Trimming PinPopular
David Skelly25-Apr-10 22:44
David Skelly25-Apr-10 22:44 
GeneralVC 2003 & 2005 compilo bug... Pin
achainard22-Apr-10 21:47
achainard22-Apr-10 21:47 
Test App : MFC dialog typed (unmanaged)

Code:
char szModel1 [256] = { "REQ$-$$$$-$$$$-$$$$-$$$$-$$$$" };
size_t sizeModel1 = strlen ( szModel1 );

char szModel2 [256] = { "REQ?-????-????-????-????-????" };
size_t sizeModel2 = strlen ( szModel2 );


Result on debugger on VC2003 & VC2005, I don't test it on 2008 & 2010 if some one can try...
+ szModel1 0x0012fc10 "REQ$-$$$$-$$$$-$$$$-$$$$-$$$$" char [256]
+ szModel2 0x0012fafc "REQ?-??~??~??~??~????" char [256]
sizeModel1 29 unsigned int
sizeModel2 21 unsigned int

The content and the size of the string is bad with "??-" sequence...
Strange Confused | :confused:
...

AnswerRe: VC 2003 & 2005 compilo bug... Pin
Peter_in_278022-Apr-10 22:12
professionalPeter_in_278022-Apr-10 22:12 
GeneralRe: VC 2003 & 2005 compilo bug... Pin
Kevin Drzycimski23-Apr-10 10:11
Kevin Drzycimski23-Apr-10 10:11 
GeneralClass with comments that say "Do not use" Pin
Abhinav S15-Apr-10 22:31
Abhinav S15-Apr-10 22:31 
GeneralRe: Class with comments that say "Do not use" Pin
DaveAuld15-Apr-10 22:40
professionalDaveAuld15-Apr-10 22:40 
GeneralRe: Class with comments that say "Do not use" Pin
Abhinav S15-Apr-10 22:46
Abhinav S15-Apr-10 22:46 
JokeRe: Class with comments that say "Do not use" Pin
Stanciu Vlad15-Apr-10 23:19
Stanciu Vlad15-Apr-10 23:19 
GeneralRe: Class with comments that say "Do not use" Pin
Keith Barrow15-Apr-10 23:27
professionalKeith Barrow15-Apr-10 23:27 
GeneralRe: Class with comments that say "Do not use" Pin
Ray Cassick16-Apr-10 1:01
Ray Cassick16-Apr-10 1:01 
GeneralRe: Class with comments that say "Do not use" Pin
Keith Barrow16-Apr-10 2:52
professionalKeith Barrow16-Apr-10 2:52 
GeneralRe: Class with comments that say "Do not use" Pin
Pete O'Hanlon16-Apr-10 1:12
mvePete O'Hanlon16-Apr-10 1:12 
GeneralRe: Class with comments that say "Do not use" Pin
Abhinav S16-Apr-10 1:35
Abhinav S16-Apr-10 1:35 
GeneralRe: Class with comments that say "Do not use" Pin
Chris Meech19-Apr-10 6:46
Chris Meech19-Apr-10 6:46 
GeneralRe: Class with comments that say "Do not use" Pin
O.Phil16-Apr-10 3:34
O.Phil16-Apr-10 3:34 
GeneralRe: Class with comments that say "Do not use" Pin
Nish Nishant16-Apr-10 3:27
sitebuilderNish Nishant16-Apr-10 3:27 
GeneralRe: Class with comments that say "Do not use" Pin
Abhinav S17-Apr-10 5:43
Abhinav S17-Apr-10 5:43 
GeneralRe: Class with comments that say "Do not use" Pin
Chris Meech19-Apr-10 6:49
Chris Meech19-Apr-10 6:49 
GeneralRe: Class with comments that say "Do not use" Pin
Gregory Gadow29-Apr-10 5:35
Gregory Gadow29-Apr-10 5:35 

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.