How about just changing the function to this:
Code:
char test(const char* s1,const char* s2)
{
	char* tmp;
	strncpy(tmp,s1,10);
	strncat(tmp, s2,10);
	cout << tmp;

	return 'a';
}