Re: Declaring variables in "case" blocks?
- From: Flash Gordon <spam@xxxxxxxxxxxxxxxxxx>
- Date: Tue, 31 Jul 2007 21:44:35 +0100
Robbie Hatley wrote, On 31/07/07 21:20:
"Keith Thompson" <kst-u@xxxxxxx> wrote:
"Robbie Hatley" <see.my.signature@xxxxxxxxxxxxxxxxxxxx> writes:
<snip>
You'd have been better off posting a small compilable program,
so you could confirm that the problem is still there.
I (mostly) did. If you #define WHATEVER, then call Function()
from main(), it will compile and run.
Hmmm... let me try that.
Ok, I just compiled and ran my stripped-down version here,
with a sprintf() of DumVar to a char buffer, and printed the buffer
in a popup message box. It displays as "72". Oops. Problem went
away. Weird.
<snip>
This is why you should always reduce your code to a small compilable example that exhibits the problem (obviously, if the problem is it not compiling then it does not need to be compilable!). There is no point other people trying to debug a problem in code that does not exhibit the problem.
--
Flash Gordon
.
- References:
- Declaring variables in "case" blocks?
- From: Robbie Hatley
- Re: Declaring variables in "case" blocks?
- From: Keith Thompson
- Re: Declaring variables in "case" blocks?
- From: Robbie Hatley
- Declaring variables in "case" blocks?
- Prev by Date: Re: Bounds checking and safety in C
- Next by Date: Re: Bounds checking and safety in C
- Previous by thread: Re: Declaring variables in "case" blocks?
- Next by thread: Re: Declaring variables in "case" blocks?
- Index(es):
Relevant Pages
|