As noted in the comments, providing a Minimal, Complete and Verifiable example would have made it easier to understand your question, but I think I understand what you're trying to do. Making minimal modifications to your code, one solution might be this:
#include <iostream>
#include <string>
using namespace std;
string original = "xxxx, x xxxxx, xx x xxxxxx xxxxxxxx.";
string letters = "ThisIthinkisabetterquestion";
string desired = "This, I think, is a better question.";
int main()
{
string fixed;
int i, j;
int originalSize = original.size();
for(i=j=0; i < originalSize ;i++)
{
if(!isalnum(original[i]))
{
fixed += original[i];
}
else
{
fixed += letters[j++];
}
}
cout << fixed << endl;
cout << desired << endl;
return 0;
}