title: Declaring syntax error int main()
body: <p>So I am new to programming and i am trying to make a program that removes white space from a word that is put in. unfortnately, when I add a void function, it gives me a declartion error. </p>
  
  <pre><code>include&lt;iostream.h&gt;
  include&lt;string.h&gt;
  
  void removeSpaces(char secretWord[30], int n)
  int main()
  {
      char secretWord[30];
      int n;
  
      cout &lt;&lt; "Enter a secret word: " &lt;&lt; endl;
      cin &gt;&gt; secretWord;
  
      cout &lt;&lt; secretWord &lt;&lt;endl;
  
      removeSpaces(secretWord[30], n)
      cout &lt;&lt; n &lt;&lt; endl;
      return 0;
  }
  
  void removeSpaces(char secretWord[30], int&amp; n)
  
  {
  
      int n;
      bool found;
  
      n = 0;
  
      while (secretWord[30] &amp;&amp; n &gt;= 0)
          {
              if(secretWord[30] != ' ')
                  found = true;
  
              else
                  n=n-1;
          }
  }
  </code></pre>
  
  <p>the error is on the int main() line. any help would be great. thanks!</p>