title: Strange letter print out from array c programming
body: <p>I am trying to delete the blank space between a string and print out the first word with isalpha() function.</p>
  
  <p>When I print out, only the first letter prints out. exempel "hello big panda" I get "hhhhh" but I want the hole word "hello" instead</p>
  
  <pre><code>int main()
  {
      char inputString[]={"hello big panda"};
       int k=0;
  
      int i=0;
      do
      {
      inputString[i];
      i++;
      }
      while (inputString[i]=isalpha(inputString[i])); 
  
      for(i=0; inputString[i] !='\0' ;i++)
      {
          for (k=i; inputString[k] != '\0'; k++)
          {
              inputString[k] =inputString[i];
          }
      }
      printf("%s", inputString);
  
      return 0;
  }
  </code></pre>
  
  <p>done this:</p>
  
  <pre><code>int printfirstword(char sentence[])
  {
      int k=0;
      int i=0;
      while (isalpha(sentence[i])) //checking for the first blank space
      {
          i++;
      }
      sentence[i] = '\0';
  
      printf("%s\n", sentence);
  
      return 0;
  }
  int main()
  {
  
          char sentence[100];
      int wordNumber;
      char answer;
  
      printfirstword("Hello there")
  return0;
  }
  </code></pre>
  
  <p>But I don't want to change the string that is passed to it</p>