title: Lottery Program Problems
body: <p>I'm currently in progress of creating my second main C program. I've only just started to learn C and I've had a few problems, as well confusion on what to do next with this program. </p>
  
  <p>The idea is to basically allow the user to enter in a desired amount of years, then the program simulates the lottery games played every week, depending on how many years they enter. Then inside the program, I want the two arrays to compare to each other and check for any numbers they both have at the same time. The lottery ticket on the user's end stays the same, which is set inside the array and of course, the random lottery numbers change every week. </p>
  
  <p>The basics are done, I'm just having a few problems, as well as not knowing where to go in certain areas.</p>
  
  <p>Problems:<br>
  "int weeks = year * 52" doesn't work, says the initializer element isn't constant.</p>
  
  <p>When I return the get_lotto_draw, I just get a bunched up number, it's not seperated in anyway, so I'm not sure how to do that. </p>
  
  <pre><code>#include &lt;stdio.h&gt; //Alows input/output operations
  #include &lt;stdlib.h&gt; //Standard utility operations
  
  //Declaring Variables
  int year;
  char name[15];
  char option;
  int lotteryPlayer[] = {5,11,15,33,42,43};
  int i;
  int randomNums[49];
  int *lotteryPtr = lotteryPlayer;
  int *randomPtr = randomNums;
  int weeks = 0;
  
  void print_array(int *lotteryPtr);
  int* get_lotto_draw(int *randomPtr);
  
  //Main Method
  int main(int argc, char *argv[])
  {
      start: //Start of program
  
      printf("\n---------------------------");
      printf("\nProject: Jackpot Dreams ");
      printf("\n---------------------------\n");
  
     printf("\nWhat is your First Name?:&gt; "); //Asks them for their choice
     scanf("%s", &amp;name); //Reads the input
  
     printf("\nHow Many Years to Sleep?:&gt; "); //Asks them for their choice
     scanf("%d", &amp;year); //Reads the input
     weeks = year * 52;
  
     printf("\nOk %s, I will play the lottery for %d years!\n",name, year);
     sleep(1500);
     printf("Sweet Dreams %s, don't let the bed bugs bite", &amp;name);
     sleep(1500);
     printf(". ");
     sleep(1500);
     printf(". ");
     sleep(1500);
     printf(".");
     sleep(2000);
  
     printf("%d", get_lotto_draw);
     system("PAUSE");
  }
  
  //Returns an array of six random lottery numbers 1-49
  int* get_lotto_draw(int *randomPtr) 
  {
      for (i=0 ; i&lt;weeks ; i++)
         return randomNums;  
  }
  
  //Print out the content of an array
  void print_array(int *lotteryPtr)
  {
       printf("Hello");
  }
  
  //Returns number of matches between two arrays
  int find_matches(int * lotteryPtr, int * randomPtr)
  {
  
  }
  </code></pre>
  
  <p>Update:</p>
  
  <pre><code>#include &lt;stdio.h&gt; //Alows input/output operations
  #include &lt;stdlib.h&gt; //Standard utility operations
  
  //Declaring Variables
  int year;
  char name[15];
  char option;
  int lotteryPlayer[] = {5,11,15,33,42,43};
  int i;
  int randomNums[49];
  int *lotteryPtr = lotteryPlayer;
  int *randomPtr = randomNums;
  int weeks = 0;
  
  void print_array(int *lotteryPtr);
  int* get_lotto_draw(int *randomPtr);
  
  //Main Method
  int main(int argc, char *argv[])
  {
      start: //Start of program
  
      printf("\n---------------------------");
      printf("\nProject: Jackpot Dreams ");
      printf("\n---------------------------\n");
  
     printf("\nWhat is your First Name?:&gt; "); //Asks them for their choice
     scanf("%s", name); //Reads the input
  
     printf("\nHow Many Years to Sleep?:&gt; "); //Asks them for their choice
     scanf("%d", &amp;year); //Reads the input
     weeks = year * 52;
  
     printf("\nOk %s, I will play the lottery for %d years!\n",name, year);
     sleep(1500);
     printf("Sweet Dreams %s, don't let the bed bugs bite", &amp;name);
     sleep(1500);
     printf(". ");
     sleep(1500);
     printf(". ");
     sleep(1500);
     printf(".");
     sleep(2000);
  
     printf("%d", get_lotto_draw(*randomPtr));
     system("PAUSE");
  }
  
  //Returns an array of six random lottery numbers 1-49
  int* get_lotto_draw(int *randomPtr) 
  {
      for (i=0 ; i&lt;weeks ; i++)
         return randomNums;  
  }
  
  //Print out the content of an array
  void print_array(int *lotteryPtr)
  {
       printf("Hello");
  }
  
  //Returns number of matches between two arrays
  int find_matches(int * lotteryPtr, int * randomPtr)
  {
  
  }
  </code></pre>