NO

Author Topic: issues with callback  (Read 1979 times)

RaginCajun

  • Guest
issues with callback
« on: January 25, 2011, 12:25:13 AM »
I am new to programming, I am having an issue with the pelles compiler. i have written a very basic program as follows:
#include <stdio.h>
#include <math.h>
int
main()
{
   float VS;

   printf("Please enter Voltage source.\n");
      scanf("%f", &VS);

   printf("Voltage is %f\n", &VS);

   system("pause");
   return (0);
}

my issue is when i input voltage as any number i get the number .007813 in return i dont understand why it is not returning the number i am assigning anyone have any suggestions?

CommonTater

  • Guest
Re: issues with callback
« Reply #1 on: January 25, 2011, 01:58:44 AM »
  printf("Voltage is %f\n", &VS);    .... actually prints the address of VS not the value contained at that address ...  lose the & and it should work better.