Hello all,

as easy as it may seem (!) it is not working with me
I have a file 'value' that contains a float of the form 1.23464
I need to read it and store it in a variable of type float called norme.

it did not work!
So i read it as string and now i need to convert the string back to float
as in:
     filePtr = fopen ("value", "r");
     
      if (  filePtr == NULL)
        {
          printf ("Not found!\n");
        }
      else 

{
          fscanf (filePtr, "%s", polynorme);
          printf (" Got it a string %s
\n", polynorme);
          fclose (filePtr);
        }
Up till here it worked.

but,      
        norme = (float) polynorme;
        printf (" Got it as
float !! %d \n", norme);

castind did not work.

Any ideas how to make it run!

thanks a lot.

        ~ibrahim

Reply via email to