[..]
>
> One should be able to do:
>
> char *p;
> char s[..];
> fgets(s, ..);
> if ( p = strchr(s, ':') )
> { *p = '\0'; do_something(s); *p = ':'; }
>
> ..without having to cast away const: p = (char*)strchr(s, ':')
Right.
> On my fedora 5 box strchr(3) shows:
>
> char *strrchr(const char *s, int c);
>
Yes, I remember now. The above is the C declaration.
C++ has overloading, so in C++ it's
char* strrchr(char* s, int c);
char const* strrchr(char const* s, int c);
Which makes perfect sense: on a const string you get a const
return value; on a non-const string you get a non-const return
value.
Apparently the OP's compile environment picks up the C version.
Cheers,
Stan
_______________________________________________
fltk mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk