Pelles C forum

C language => Beginner questions => Topic started by: RaginCajun on January 25, 2011, 12:25:13 AM

Title: issues with callback
Post by: RaginCajun 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?
Title: Re: issues with callback
Post by: CommonTater 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.