title: Returning values in C
body: <p>Ok I am just completely stuck on my homework and my brain is not working right now. I'm still not that good of a programmer so I need help on wondering what's happening in the code how I can fix them. </p>
  
  <p>I am have trouble understanding using pointers.</p>
  
  <p>I'm not sure if I am doing it right of trying to return values.
  There is going to be another program that I have to code to actually use these functions but I was given this one to work on first.</p>
  
  <p>For the Add Function, I am trying to make the item point to each parameter to get the data. </p>
  
  <p>For the AddItem Function, I am trying to have a new item point to item from the Add Function and get that data. </p>
  
  <p>Contain Function(Still working on): I have to take a parameter from AddItem Function. Return true if item exists, false if doesn't.</p>
  
  <p>Get Function(Still working on): Same parameter as Contain function. Return pointer of the found item, or NULL if item not found.</p>
  
  <p>Data.h</p>
  
  <pre><code>  #ifndef DATA_H_
    #define DATA_H_
  
    /*
     * Database Struct
     */
      typedef struct
      {
         /*char *array[10];*/
          Iteminfo *itemdata;
          int counter;
      }databaseinfo;
  
      /*
       * Item Struct
       */
       typedef struct
       {
       int IDnum;
        double price;
       char * Name;
       }Iteminfo;
  
      /*
       * Prototypes
        */
           char DatabaseManage();
           int Add();
           char AddItem();
           int Contains();
           int Get();
  
           #endif /* DATA_H_ */
  </code></pre>
  
  <p>DatabaseManage.c</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include "Data.h"
  
     /*
      * Constructor Function
      * @Parameters databaseinfo, count
      * Creates and returns the database
      */
       databaseinfo constructor(Iteminfo *itemdata, int counter)
       {
         databaseinfo *newdb = malloc(sizeof(databaseinfo));
         return constructor;
  
       }
       /*
      * Add Function
      * @Parameters Iteminfo, IDnum, price, Name
      *  Adds an item to the database
      */
         int Add(Iteminfo *item, int IDnum, double price, char * Name)
         {
        item-&gt;IDnum = IDnum;
        item-&gt;price = price;
        item-&gt;Name = Name;
  
        return item;
     }
  
     /*
      * AddItem Function
      * @Parameters Iteminfo
      * Copies item to database
      */
      char AddItem(Iteminfo *item, char * newItem)
       {
       newitem-&gt;item = item;
        return copyitem;
  
       }
  
      /*
       * Contains Function
       * @Parameter
       * Returns if the item exists or not in the database
       */
      int Contains(void)
      {
  
      }
  
      /*
       * Get Function
       * @Parameters
       * Returns the pointer of the item from the database
       */
       int get(void)
       {
  
       }
  </code></pre>