title: Removing spaces from a string
body: <p>I am trying to copy from one string to another, but the second string should omit the space. I tried to approach this by saying, if a character in the original string is a space, do not copy it. Instead, copy the next character. However, the program deletes everything after the space. Any ideas?</p>
  
  <pre><code>char deleteSpaces(char phrase[256], int length){
  int j, i=0;
  char phrase2[length];
    for(j=0;j&lt;length;j++){
      if(phrase[i]==' '){
          phrase2[j]=phrase[i+1];
          i++;
          }
      phrase2[j]=phrase[i];
    }
  
  return phrase2;
  }
  </code></pre>