fork download
  1. #include <iostream>
  2. #include <cstdlib>
  3.  
  4. using namespace std;
  5. int main(int argc, char *argv[]) {
  6. char c[] = {'0','.','5'};
  7. char d[] = {'6','7','8'};
  8. //char c[] = "0.5";
  9. float f = atof(c);
  10. float g = atof(d);
  11. cout << f*10;
  12. }
Success #stdin #stdout 0s 2896KB
stdin
Standard input is empty
stdout
5.678