title: how to solve exit status 1 error?
body: <p>I want to write c++ code which will separate all elements which have same length as input value </p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;vector&gt;
  using namespace std;
  string database[] = {"green", "stupid", "boy", "girl", "forest", "mobile", "morning", "love", "keyboard", "incredible"};
  string input;
  string count(string input, string database[]){
      string lengthFilter[] = {};
      int inputLength = input.length();
      for (int i = 0; i &lt; database-&gt;length(); ++i){
          if (database[i].length() == inputLength)
          {
              lengthFilter[lengthFilter-&gt;length()] = database[i];
  
          }
      }
      return (lengthFilter);
  }
  
  int main()
  {
      cin &gt;&gt; input;
      cout &lt;&lt; count(input, database);
      return 0;
  }
  </code></pre>
  
  <p>but it gives error</p>
  
  <pre><code>main.cpp: In function 'std::__cxx11::string count(std::__cxx11::string, std::__cxx11::string*)':
  main.cpp:16:22: error: could not convert 'lengthFilter' from 'std::__cxx11::string [0] {aka std::__cxx11::basic_string&lt;char&gt; [0]}' to 'std::__cxx11::string {aka std::__cxx11::basic_string&lt;char&gt;}'
    return (lengthFilter);
                        ^
  
  exit status 1
  </code></pre>
  
  <p>I can't find my mistake, please, help me.</p>