Okay, what happened to my literal strings?

Janice Caron caron800 at googlemail.com
Mon Sep 10 06:19:56 PDT 2007


I realise this isn't actually meeting the challenge set, but there is one
really easy workaround you could do...

int strchr(const char *p, char c);

Just make the return value the offset from the start of p (or -1 if not
found) instead of a pointer. That way, on return from the function, p[n]
will be const or not const as desired.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20070910/e2c65cab/attachment.html>


More information about the Digitalmars-d mailing list