title: How do I return a struct from a function to a struct pointer?
body: <p>I am creating a function for a code and the code uses the function that outputs to a file pointer like for example, </p>
  
  <pre><code>number *base6 = intToNumber(50, 6); 
  </code></pre>
  
  <p>Here is the code I have so far:</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  #include &lt;string.h&gt;
  #include &lt;stdlib.h&gt;
  
  typedef struct {
    int iNum;
    int base;
    char* sNum;
  } number;
  
  number * intToNumber(int nnum, int nbase) {
    number * theNumbers;
  
    //theNumbers= (number*)malloc(10*sizeof(number));
  
    if (theNumbers = NULL) {
      printf("\n\nNo\n\n");
      exit(1);
    }
  
    theNumbers-&gt;iNum = nnum;
    theNumbers-&gt;base = nbase;
  
  }
  </code></pre>