title: C programming Data structures User Input Fail to initialize a struct type Visual Studio
body: <p>In the .h file I have, </p>
  
  <pre><code>typedef struct {
  int month;
  int day;
  }Date;
  
  typedef struct {
  char courseName[30];
  char assignName[30];
  int points;
  Date duedate;
  }QueData;
  </code></pre>
  
  <p>And this below is in the .c file</p>
  
  <pre><code>int main(int argc, char argv[]) {
  
  QuePtr priority_hw;
  NodePtr FrontNode;
  priority_hw = initQueue(10);
  
      char UserInput1[30], UserInput2[20];
  int UserInput3, UserInput4, UserInput5;
  
  printf("Please enter 1st Course name \n");
  scanf("%s", &amp;UserInput1);
  printf("Please enter 1st Assignment name \n");
  scanf("%s", &amp;UserInput2);
  printf("Please enter 1st Assignment's points  \n");
  scanf("%d", &amp;UserInput3);
  printf("Please enter 1st Assignment's duedate month  \n");
  scanf("%d", &amp;UserInput4);
  printf("Please enter 1st Assignment's duedate day  \n");
  scanf("%d", &amp;UserInput5);
  
  
  printf("Entered Name: %s\n", UserInput1);
  printf("Entered Website:%s", UserInput2);
  
  Date duedate1 = { UserInput4, UserInput5 };
  QueData assignment1 = { UserInput1, UserInput2, UserInput3, duedate1 };
  </code></pre>
  
  <p>But red line appears under duedate1 in the initialization of assignment1. It says it cannot replace char type with "Date" which I defined as a struct with fields day and month. But as you can see in the .h file, QueData struct's 4th field is "Date". Despite this, why does it ask for char ?
  I tried </p>
  
  <pre><code>    QueData assignment1 = { UserInput1, UserInput2, UserInput3, {UserInput4, UserInput5} }; 
  </code></pre>
  
  <p>too but it would say "too many initializer values".</p>
  
  <p>However, if I do </p>
  
  <pre><code>QueData assignment1 = { "calc1", "hw5", 10, { 1, 11 } }; 
  </code></pre>
  
  <p>it works. How come when I change these values to variables it doesn't work?</p>