OK, I figured it out. Here&#39;s how you do it in C.<br><br>&nbsp;#define strchr(p,c) (p + istrchr(p,c))<br>&nbsp;<br>&nbsp;int istrchr(const char * p, char c)<br>&nbsp;{<br>&nbsp;&nbsp;&nbsp;&nbsp; int i;<br>&nbsp;&nbsp;&nbsp;&nbsp; for (i=0; p[i]; ++i)<br>&nbsp;&nbsp;&nbsp;&nbsp; {<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; if (p[i] == c) return i;
<br>&nbsp;&nbsp;&nbsp;&nbsp; }<br>&nbsp;&nbsp;&nbsp;&nbsp; return (const char *)0 - p;<br>&nbsp;}<br><br><br>As required, the parameter is const at the callee site, but the output is the same type as the input at the caller site.<br><br><br>