#include <iostream>

// This is the correct declaration of the parameter
int my_strlen(const char *s)
{
    // Which requires const char* here:
    const char *p = s;

    // 7_const.cpp: In function `int my_strlen(const char*)':
    // 7_const.cpp:8: assignment of read-only location
    while ( ! (*p = 0) ) ++p;
    return p - s;
}

int main()
{
    char t[] = "Hello";
    std::cout << my_strlen(t) << std::endl;  // t converted to const char *
    return 0;
}