title: error: pointer value used where a floating point value was expected
body: <p>This is not homework, but my last assignment made it clear that I didn't clearly understand pointers when coding C.</p>
  
  <p>Therefore, I tried to type a simple program using pointers just to invert an integer in a function, so I could figure out where the gap in my understanding is.</p>
  
  <p>Apparently, I've arrived at it, but I still cannot figure out what I am doing wrong.</p>
  
  <p>My source code is below.</p>
  
  <pre><code>#include &lt;stdio.h&gt;
  
  float invert(int *num);
  
  void main (void)
  {
  int num;
  float a;
  
  printf("enter an integer \n");
  
  scanf("%i", &amp;num);
  
  printf("Number entered %i \n", num);
  
  a=invert(&amp;num);
  
  printf("This is the invse from main %f \n", a);
  
  }
  
  
  float invert(int *num) /* function inverts integer */
  
  {       
  float invse;
  
  printf("num is %i \n\n", *num);
  
  invse = 1/(float)num;
  
  printf("invse is %f \n\n", invse);
  
  return(invse);
  
  }
  </code></pre>
  
  <p>My thinking was that I used the pointer to direct the computer to use the value stored at the address for num in the function invert().  The pointer appears in the variable declaration.  I cast the value stored at that pointer as a float, so I could invert it, and store it in a local variable.</p>
  
  <p>The problem appears to be in the local variable assignment.  My compiler returns "invert.c:29:2: error: pointer value used where a floating point value was expected
    invse = 1/(float)num;
    ^</p>
  
  <p>Apparently my code indicates a pointer value for inverse, but I declared it as a float, which I find confusing.</p>
  
  <p>Any help is appreciated.  This will save me on completing my larger set of code for my assignment, which I did not post here.</p>
  
  <p>Thanks.</p>