OT: CS education gone wrong (Was: Re: TDD is BS?)

Andrej Mitrovic andrej.mitrovich at gmail.com
Sat Jun 22 06:37:13 PDT 2013


On 6/22/13, Adam D. Ruppe <destructionator at gmail.com> wrote:
> On Saturday, 22 June 2013 at 11:01:53 UTC, Andrej Mitrovic wrote:
>> - You're casting a const char * to a char * in the return, you
>> should instead provide an overload of strstr taking char* and
>> returning char*.
>
> I'm pretty sure the C standard says to do it with the const arg
> but mutable return.
>
> http://en.cppreference.com/w/c/string/byte/strstr
>

Ah, I momentarily forgot C doesn't have overloading, which is probably
where Walter's function was implemented in. In C++ there are overloads
of this function:

http://www.cplusplus.com/reference/cstring/strstr/


More information about the Digitalmars-d mailing list