title: ‘std’ does not name a type and expected initializer before a function
body: <p>below is my code which tries to separate a string "key=value" into two subarrays "key" and "value" and here are the errors:</p>
  
  <p>string2StringPair.cc:9:3: error: ‘std’ does not name a type; 
  string2StringPair.cc:10:3: error: ‘std’ does not name a type; 
  string2StringPair.cc:13:12: error: expected initializer before ‘string2StringPair'</p>
  
  <pre><code>#ifndef __PARSE_H_
  #define __PARSE_H_
  
  #include "cppstd.hh"
  #include &lt;string&gt;
  using namespace std;
  
  struct StringPair{
    std:string key; 
    std:string value;
  }
  
  StringPair string2StringPair (char* str[]){
    std:string x, y;
    x = ""; y = "";
    for (int i=0;i&lt;str.length();i++){
      if str[i]=="="{
          for (int j=0;j&lt;i;j++){
        x=x+str[j];
      }
          for (int k=(i+1);k&lt;str.length();k++){
        y=y+str[k];
      }
          break; 
      }
    }
    if ((x=="") &amp;&amp; (y=="")){
      cout&lt;&lt;"ERROR: There is no = in the input string!"&lt;&lt;endl;
    }
  
    StringPair tmp;
    tmp.key = x; 
    tmp.value = y;
    return tmp;
  } 
  
  #endif
  
  int main(int argc, char *argv[]){
    StringPair pair;
    pair.string2StringPair(argv[1]);
    cout&lt;&lt;"The pair is "&lt;&lt;pair&lt;&lt;endl;
    return 0;
  }
  </code></pre>
  
  <p>would really appreciate if you could help me fix the errors.  </p>
  
  <p>When I changed to </p>
  
  <pre><code>std::string key; 
  std::string value;
  </code></pre>
  
  <p>There was no more "std" error. Why??</p>
  
  <p>Why is an initializer expected before string2StringPair? I though I already had one: StringPair?</p>