> > + dst_exten[0] = '\0';
>
> Is this 'construct' prefered over
>
> dst_exten[0] = 0;
> or
> *dst_exten = 0;
>
> and why?
I'm somewhat of a C pedant here. dst_exten is declared as an array,
not a pointer. So if I want to clear the first byte of the array,
I'll use array syntax pretty consistently. If it's a pointer, I tend
to prefer the pointer syntax, unless I'm also doing something with
other than the first byte. So I wouldn't write:
*x = 'a';
x[1] = '\0';
but instead
x[0] = 'a';
x[1] = '\0';
And I certainly don't like using 0 when I mean "the null character",
at least not in an assignment.
--
_____________________________________________________________________
-- Bandwidth and Colocation Provided by http://www.api-digital.com --
New to Asterisk? Join us for a live introductory webinar every Thurs:
http://www.asterisk.org/hello
asterisk-users mailing list
To UNSUBSCRIBE or update options visit:
http://lists.digium.com/mailman/listinfo/asterisk-users