title: how to clear() integer in c++
body: <p>I try to fill two-dimension array with words. i have 'sliced' the temporary string into single chars stored in temporary one dimension array. at he end of main 'for' loop i want to reset all temporary variables. The problem is that i cannot clear integer. Any ideas how to proceed?</p>
  
  <pre><code>#include &lt;iostream&gt;
  #include &lt;cstring&gt;
  using namespace std;
  int main()
  {
  for(int j=0; j!=4; j++)
  {
      if (j==0)
      cout &lt;&lt; "text1: \n";
      else if(j==1)
      cout &lt;&lt; "text2: \n";
      else if(j==2)
      cout &lt;&lt; "text3: ?\n";
      else if(j==3)
      cout &lt;&lt; "text4: \n";
      string temp; getline(cin, temp);
      int lenght = temp.size();
      char test[lenght+1];
      strcpy(test, temp.c_str());
      char tab[4][lenght];
      for(int i=0; i!=lenght+1; i++)
      {
          tab[j][i]=test[i];
      }
      temp.clear();
      lenght.clear();   //error
      test.clear();
  }
      return 0;
  }
  </code></pre>
  
  <p>and this is the error</p>
  
  <pre><code>/root/Dokumenty/fgfg/main.cpp|26|error: request for member ‘clear’ in ‘lenght’, which is of non-class type ‘int’|
  </code></pre>