title: C: Convert char to float
body: <p>I want to convert a char to a float in language C.
  But atof() and strtof() are not working.</p>
  
  <p>Here is some code, maybe someone could help me!
  The difficulty is that my number has a e-02 included</p>
  
  <pre><code>char temp = "6.345e-02"; // the original value is read from a file
  float result;
  
  result = atof(temp); //not working correct
  result = strtof(temp, NULL); //also not working correct
  </code></pre>
  
  <p>edit: new code</p>
  
  <pre><code>FILE *file = fopen("file.txt", "r");
  char c;
  char *temp[11];
  float result;
  while((c=fgetc(file))!=EOF){
    if(c=='\t'){
      result = atof(temp); //here is the converting problem
      printf("%.6f\n", result);
    } else {
      temp[i] = c;
    }
  }
  </code></pre>