:: Re: [DNG] "Common knowledge?"-quest…
Page principale
Supprimer ce message
Répondre à ce message
Auteur: Dr. Nikolaus Klepp
Date:  
À: dng
Sujet: Re: [DNG] "Common knowledge?"-question
Am Freitag, 22. Januar 2016 schrieb Rainer Weikusat:
> Can the effect of the following C function
>
> static void print_start(char const *name, char const *what)
> {
>     char *buf, *p;
>     unsigned name_len, what_len, total;

>
>     name_len = strlen(name);
>     what_len = strlen(what);
>     total = name_len + what_len + 3;

>
>     p = buf = alloca(total);
>     memcpy(p, name, name_len);
>     p += name_len;
>     *p++ = ' ';
>     memcpy(p, what, what_len);
>     p += what_len;
>     *p++ = ':';
>     *p = ' ';

>
>     *buf &= ~0x20;

>
>     Write(2, buf, total);
> }

>
> be considered obvious or should it rather get an explanation?


just out of couriosity: why don't you use "strcat"?


--
Please do not email me anything that you are not comfortable also sharing with the NSA.