Re: Where the code trouble is?



Anton Petrusevich wrote:
>
> CBFalconer wrote:
>
> > #define BUFSIZE 80
> > #define CAPTION " the Great"
> >
> > int main(void) {
> > char name[BUFSIZE + 1 + strlen(CAPTION)];
>
> Excuse my ignorance, but does it really work? Well, I tried it with gcc and
> I see that it really works, but since when?

That should really have been sizeof(CAPTION) to be portable to
C90. Then it doesn't need the +1 either.

--
Chuck F (cbfalconer@xxxxxxxxx) (cbfalconer@xxxxxxxxxxxxxxxx)
Available for consulting/temporary embedded and systems.
<http://cbfalconer.home.att.net> USE worldnet address!


.



Relevant Pages