fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4.  
  5. char * str = "1.45";
  6.  
  7. float flt;
  8.  
  9. sscanf(str, "%f", &flt);
  10.  
  11. printf("value = %f\n", flt);
  12.  
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2008KB
stdin
Standard input is empty
stdout
value = 1.450000