title: Some problems with struct
body: <pre><code>#include &lt;iostream&gt;
  using namespace std;
  struct student{
      char name[10];
      int  grade;
  };
  
  
  int main() {
      struct student s[10];
      student s[0].name = "Jack";
      cout&lt;&lt;s[0].name;
  }
  </code></pre>
  
  <p>I want to create the struct type data <code>student</code> as an arraign. But when I did it like this, some errors appeared and I didn't know why.Following are the errors:</p>
  
  <p>1.error: redefinition of 's' with a different type: 'student [0]' vs 'struct student [10]'</p>
  
  <pre><code>    student s[0].name = "Jack";
              ^
  </code></pre>
  
  <p>2.note: previous definition is here</p>
  
  <pre><code> struct student s[10];
                  ^
  </code></pre>
  
  <p>3. error: expected ';' at end of declaration</p>
  
  <pre><code> student s[0].name = "Jack";
                  ^
                  ;
  </code></pre>