Ah, I think I understand now. So, when it hits 127, it is suppose to go back to 32 and add what was left over. In that case, your if statement is justified:
Code:
if (int(encrypted[i]) + key > 126)
               {
                  encrypted.push_back(char(32 + ((int(encrypted[i]) + key) - 127)));       
               }
So, your function pretty much works without the key loop:
Code:
string decode(vector <char> encrypted, int key) 
{
       string decode; 
       int size = encrypted.size(), i = 0;
       for (i; i < size; i++)       {
         
               if (int(encrypted[i]) + key > 126)
               {
                  encrypted.push_back(char(32 + ((int(encrypted[i]) + key) - 127)));                }
               else
               {
                   encrypted.push_back(char(int(encrypted[i]) + key));                }
           
       }
print
}
The only problem is you are adding the decoded message to the end of the coded message in the vector. So, printing the results (where I marked red) with:
Code:
for(int j = 0; j < encrypted.size(); j++)
		{
			cout << encrypted[j];
		}
will print "Fcjjm}rfcpc,Hello there.". If you changed the initialization of j to "size" in the for loop, then it will print "Hello there.". However, this probably isn't the best way to handle the problem, unless you are wanting to keep the coded message stored for some reason. Even then, I would think it would be best to keep them in separate vectors. If you don't need the old coded message stored, then just change:
Code:
encrypted.push_back(char(int(encrypted[i]) + key));  

to

encrypted[i] = (char(int(encrypted[i]) + key));