title: Store the same string in two different struct types
body: <p>I'm working on structures, and I need to assign a string in a char array. Here is my some spesific parts of my code:</p>
  
  <pre><code>typedef struct{
      int std_id;
      char std_name[STD_NAME_SIZE];
      double gpa;
      char courses[COURSE_SIZE];
  }student_t;
  
  typedef struct{
      int course_id;
      char course_name[COURSE_NAME_SIZE];
      char course_code[COURSE_CODE_SIZE];
      char course_acronym[COURSE_ACRONYM_SIZE];
      int quota;
  }course_t;
  </code></pre>
  
  <p>this is the struct that I use.
  and this is the assignment part:</p>
  
  <pre><code>for(int i = 0; i &lt; COURSE_SIZE; i++){
          printf("Enter course name: ");
          scanf("%s", &amp;courseDetails.course_name);
          studentProfile.courses[i] = courseDetails.course_name;
  
      }
  
      for(int j = 0; j &lt; COURSE_SIZE; j++){
          printf("\nYour %d course is: %s", j + 1, studentProfile.courses[j]);
      }
  </code></pre>
  
  <p>I think the problem happens at <code>studentProfile.courses[i] = courseDetails.course_name</code> part.
  Should I use pointers? How can I solve this problem ?</p>