Well at first glance the problem appears to be in your prompt() function. It should look more like this:
Code:
char prompt(void)
{
char str[]="TEST";
cout << str[0] << " ... in prompt()\n";
return str[0];
}
I changed the function so that it returns a char, since that is all that you were doing before but perhaps you wanted your function to return the whole string. If so just have it return the char* and return str. Lose the "&" in the call to init too. You don't seem to understand how to use them properly so read up on that. Bye the way, unless the struct in the code you are using has some other variables to it then it is entirely unnecessary to make a struct that only has one variable in it.