Re: String reversing problem



Flash Gordon wrote:
> slebetman@xxxxxxxxx wrote:
> > tmp123 wrote:
> >> Hi,
> >>
> >> See inlines:
> >>
> >> Christian Bau wrote:
> >>> tmp123 wrote:
> >>>> To Mr. Christian Bau:
>
> <snip>
>
> >>> {
> >>> char tmp = s [i];
> >> 5) Declare char here, far of the semantically parent of it (char *s) it
> >> is only a way to hide things. And lots of compilers will ignore it (no
> >> new frame).
> >
> > This is correct and valid in C99 (unlike your code which is incorrect
> > and invalid in any C standard). Just because there are no C99 compilers
> > around doesn't mean that this code is not "C".
>
> Actually, you declaring a variable at the start of any block is valid
> for all versions of C.

Oh wow, tested it and it does work. I've always thought that "start of
block" refers to the start of the function. Learn something new
everyday. This is indeed nice as localising scope is usually a "good
thing"(tm).

.