title: Assigning Array to a Struct value in C
body: <p>For a homework assignment, we are working on CSV parser.  I'm trying to get things working, but I've run into an issue.  I can't seem to assign a value to "field" value in the struct.  In the code they provided they have:</p>
  
  <pre><code>typedef char f_string[MAX_CHARS+1] ;    /* string for each field */
  
      typedef struct {
          int nfields;                        /* 0 =&gt; end of file */
          f_string field[MAX_FIELDS];         /* array of strings for fields */
      } csv_line ;
  </code></pre>
  
  <p>With the above constants defined at 20 and 15.  Looking at what they have, the struct holds and int, and it holds an array that should be populated with the f_string typedef they defined earlier.  Alright, cool.  I tried to do it this way:</p>
  
  <pre><code>f_string test = "Hello, Bob";
  f_string testAgain = "this is dumb, k?";
  f_string anArray[MAX_FIELDS] = {*test, *testAgain};
  
  csv_line aLine;
  aLine.nfields = 3;
  aLine.field = *anArray;
  </code></pre>
  
  <p>When I make "anArray", if I don't have the dereferences to test and testAgain, I get warnings about making integers to pointers without a cast.  So I leave them in.  But the line:</p>
  
  <pre><code>aLine.field = *anArray;
  </code></pre>
  
  <p>Returns the error: "csv.c:87: error: incompatible types in assignment" with or without the pointer there... so I'm not sure how I should be assigning that variable?  Help would be appreciated!</p>