Hi i have just created some code to get the number out of a char array. Now i am not sure if it works. Below is the code:
Could someone please tell me if it will work.Code:
#include <stdio.h>
#include <string.h>
int main(int argc, char ** argv)
{
FILE * output = stdout;
FILE * input = stdin;
char aperture[4];
float apertureNo
fprintf(output,"Please enter the aperture value (f-stops): "); fflush(output);
fscanf(input,"%s",&aperture);
apertureNo = atof(aperture);
fprintf(output,"Your aperture is \n",aperture);
fprintf(output,"Your aperture NUMBER is \n",apertureNo);
}
For example. I enter a1.5
aperture should be: a1.5
apertureNo should be: 1.5
Will the above code do it?
thanks
