title: Linker error undefined reference , Need Help , Arrays of Structures
body: <p>Hello guys am doing my C++ Project Assignment and i have a problem here, it wont compile because of   </p>
  
  <pre><code>"[Linker error] undefined reference to " Thingy 
  </code></pre>
  
  <p>So Basically my program is more like an Enterprise.</p>
  
  <pre><code>#include&lt;stdio.h&gt;
  #include&lt;conio.h&gt;
  #define FLUSH while(getchar()!='\n')
  #include&lt;stdlib.h&gt;
  
  
  typedef struct
  {
      int ItemNumber;
      char ItemName[30];
      short ItemQuantity;
      float ItemPrice;
  } ITEM;
  
  int AddNewItem(ITEM[], int);
  void EditItemInfo(ITEM[], int);
  void Sales(ITEM[], int);
  void GoodReceipts(ITEM[], int);
  void DisplayAllItems(ITEM[], int);
  
  
  int main(void)
  {
      int int_choice;
      int int_counter = 0;
      ITEM num1[30];
      int ans;
  
      do
      {
          printf("Welcome to Tayona's Enterprise\n");
          printf("\n1] Add New Item");
          printf("\n2] Edit Item Information");
          printf("\n3] Sales");
          printf("\n4] Goods Receipt");
          printf("\n5] Display All Items");
          printf("\n6] Exit\n");
          printf("\n\nChoice:");
          scanf("%d", &amp;int_choice);
  
          switch (int_choice)
          {
          case 1:int_counter = AddNewItem(num1, int_counter);
              break;
          case 2:EditItemInfo(num1, int_counter);
              break;
          case 3:Sales(num1, int_counter);
              break;
          case 4:GoodReceipts(num1, int_counter);
              break;
          case 5:DisplayAllItems(num1, int_counter);
              getch();
          case 6:break;
          default: printf("\nPlease Try Agian...");
          }
  
          if ((int_choice &lt;= 0) || (int_choice &gt;= 7))
          {
              printf("\nNot Found in the Selection, Please Try Agian...");
              getch();
          }
  
          system("cls");
      } while (int_choice != 6);
      return 0;
  }
  int AddNewItem(ITEM num1[], int int_counter)
  {
      system("cls");
      char DetailsItem[30];
      int i = 0;
      int n;
      printf("Input item number:");
      scanf("%d", &amp;num1[i].ItemNumber);
      fflush(stdin);
  
      int_counter++;
      {
          fflush(stdin);
          printf("Input item name:");
          scanf("%s", num1[i].ItemNumber);
          fflush(stdin);
          printf("Input quantity:");
          scanf("%hd", &amp;(num1[i]).ItemQuantity);
          fflush(stdin);
          printf("Input item price:");
          scanf("%f", &amp;(num1[i]).ItemPrice);
      }
      return int_counter;
  }
  void editItemInfo(ITEM num1[], int int_counter)
  {
  
      int i = 0, int_choice;
  
      printf("Input item number:");
      scanf("%d", &amp;int_choice);
  
      for (i = 0; i&lt;int_counter; i++)
      {
          if (int_counter != 0)
          {
              printf("Input new item:");
              gets(num1[i].ItemName);
              FLUSH;
              printf("Input new item price:");
              scanf("%f", &amp;(num1[i]).ItemPrice);
          }
          else
          {
              printf("\nThere is no existing item...");
              getch();
          }
          return;
      }
  }
  void getItemSales(ITEM num1[], int int_counter)
  {
      int i = 0;
      int x = 0;
      int int_choice = 0;
  
      if (int_counter != 0)
      {
          printf("\nEnter item number: ");
          scanf("%d", &amp;int_choice);
  
          while ((i&lt;int_counter) &amp;&amp; (x == 0))
          {
              if (int_counter != 0)
                  x = 1;
              i++;
          }
          i--;
  
          if (x == 1)
          {
              printf("\nEnter Quantity: ");
              scanf("%d", &amp;int_choice);
              if (int_choice == 0)
              {
                  printf("\nThe Quantity does not exist");
                  getch();
              }
              else if (int_choice &lt;= -1)
              {
                  printf("\nThe Quantity is zero");
                  getch();
              }
              else if (int_counter != 0)
                  num1[i].ItemQuantity = num1[i].ItemQuantity - int_choice;
              else
              {
                  printf("\nThe Quantity bought is negative");
                  getch();
              }
          }
  
          else
          {
              printf("\nThere is no existing item...");
              i = 0;
              getch();
          }
      }
  
      else
      {
          printf("\nEmpty...");
          getch();
      }
  
      return;
  }
  void getItemReceipts(ITEM num1[], int int_counter)
  {
      int i = 0;
      int x = 0;
      int int_choice = 0;
  
      if (int_counter != 0)
      {
          printf("\nEnter item number: ");
          scanf("%d", &amp;int_choice);
  
          while ((i&lt;int_counter) &amp;&amp; (x == 0))
          {
              if (int_counter != 0)
                  x = 1;
              i++;
          }
          i--;
  
          if (x == 1)
          {
              printf("\nEnter item name: ");
              puts(num1[i].ItemName);
  
              printf("\nEnter Quantity: ");
              scanf("%d", &amp;int_choice);
  
              if (int_choice == 0)
              {
                  printf("\nThe Quantity does not exist");
                  getch();
              }
              else if (int_choice &lt;= -1)
              {
                  printf("\nThe Quantity received is negative");
                  getch();
              }
              else if (int_choice &gt;= num1[i].ItemQuantity)
                  num1[i].ItemQuantity = num1[i].ItemQuantity + int_choice;
          }
  
          else
          {
              printf("\nThere is no existing item...");
              i = 0;
              getch();
          }
      }
  
      else
      {
          printf("\n\Empty...");
          getch();
      }
  
      return;
  
  }
  void displayAllItems(ITEM num1[], int int_counter)
  {
      int i = 0;
      int int_choice = 0;
  
  
      if (int_counter != 0)
      {
          for (i = 0; i&lt;int_counter; i++)
          {
              printf("\nItem Number:%d", num1[i].ItemNumber);
              printf("\nItem Name:%s", num1[i].ItemName);
              printf("\nItem Quantity:%hd", num1[i].ItemQuantity);
              printf("\nItem Price:%0.2f", num1[i].ItemPrice);
          }
      }
      else
          printf("\nItem does not exist...");
      getch();
  
      return;
  }
  </code></pre>
  
  <p>When I compile I got an error of the Following</p>
  
  <pre><code>[Linker error] undefined reference to `EditItemInfo(ITEM*, int)'
  [Linker error] undefined reference to `Sales(ITEM*, int)'
  [Linker error] undefined reference to `GoodReceipts(ITEM*, int)'
  [Linker error] undefined reference to `DisplayAllItems(ITEM*, int)'
  [Linker error] undefined reference to `DisplayAllItems(ITEM*, int)' &lt;/p&gt;&lt;p&gt;  ld returned 1 exit status
  </code></pre>
  
  <p>so am confused, what mistake did i got?</p>