ARopo is right. You must provide enough space in your buffer to put the extra characters.
Use this
char s[100] = "lion";
...
And it is always a good practice to give the length of your buffer. This is called defensive programming:
void my_strcat (char *s, int maxLength, const char *t)
{
if (maxLength <= 0)
return;
int i, j;
for (i = 0; i < maxLength && s[i] != '\0'; i++);
for (j = 0; i + j < maxLength && t[j] != '\0'; j++)
s[i + j] = t[j];
if (i + j < maxLength)
s[i + j] = '\0';
else
s[maxLength - 1] = '\0';
cout << "concatenated string is " << endl << s;
}
int main ()
{
char s[100] = "lion";
char *t = "california";
my_strcat(s, 100, t);
return 0;
}