Re: strstr and strchr

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Feb 17, 2009 at 12:58, Bert Wesarg <bert.wesarg@xxxxxxxxxxxxxx> wrote:
> On Tue, Feb 17, 2009 at 12:52, Fundu <fundu_1999@xxxxxxxxx> wrote:
>> Bert,
>> i did try that but got same response.
> I'm not:
>
> int
> main(int ac, char *av[])
> {
>    char *str = "<Info firstName='sam' lastName='Smith' />";
>    char *ptr = strchr(str, '\'');
>
>    if (!ptr)
>        return 1;
>
>    printf("%s\n", str);
>    printf("%*s^\n", (int)(ptr - str), "");
>
>    return 0;
> }
>
> prints:
>
> <Info firstName='sam' lastName='Smith' />
>                ^
This looks probably wrong, because of malformed whitespace.
--
To unsubscribe from this list: send the line "unsubscribe linux-c-programming" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Linux Assembler]     [Git]     [Kernel List]     [Fedora Development]     [Fedora Announce]     [Autoconf]     [C Programming]     [Yosemite Campsites]     [Yosemite News]     [GCC Help]

  Powered by Linux