Will have A be an unchangeable pointer to the character variable a.
However, this is just a pointer. I think you want to do something like:
Code:
const char a = 'B';
char thestring[50];
thestring[0] = a;
thestring[1] = '\0';//make sure you add the null
strcat(thestring, "ecause I said so.");//this will concatenate to the string.
//now thestring is an array that contains "Because I said so."
However, that's the C-style way. The standard C++ approach is something like:
Code:
std::string thestring(1u, a);//create a string with 1 of the variable a's in it
thestring += "ecause I said so.";//add this to thestring
//now thestring has a value of "Because I said so."
//be careful, though. If you want to access a std::string like a C-style string, you should use
//the member function c_str().
//an example:
char string2[50];
strcpy(string2, thestring.c_str());
Note that the above code isn't the best -- it can definitely be made better by using dynamic allocation, but I decided to stick with simplicity here.