Code:
#include<iostream>
#include<string>
#include<cctype> // you don't need this
using namespace std;
int main()
{
string one = "hey you";
create a second string here
//Checks for letters and inserts 1 space next to each letter until it reaches the end of the string
for (int i=0; j < one.length(); i++) // where did "j" come from? Use i
{
// No need to test for isalpha. Just append the char to the new string, followed by a blank
if (isalpha(one[i])) //if character at one[i] is an alphabet, insert a space at one[i+1]
one[j+1] = ' ';
}
cout << one << endl;
return 0;
}