[LCP]which one better?

David Spencer david.w.spencer at oracle.com
Fri May 9 23:02:02 UTC 2003


Define "better."

Dave.


mehul radheshyam choube wrote:

> hi all,
>
> which one of the following is better performance wise.
>
> #define WHITESPACES        " \t\r\n"
>
> char* eat_whites(char *p)
> {
>     while(*p && strchr(WHITESPACES,*p)) {
>         p++;
>     }/* while(*p && strchr(WHITESPACES,*p)) */
>
>     return p;
> }/* eat_whites() */
>
> char* eat_whites(char *p)
> {
>     while(*p && isspace(*p)) {
>         p++;
>     }/* while(*p && isspace(*p)) */
>
>     return p;
> }/* eat_whites() */
>
>
> _______________________________________________
> This is the Linux C Programming List
> :  http://lists.linux.org.au/listinfo/linuxcprogramming List
>




More information about the linuxCprogramming mailing list