fork(2) download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void) {
  5. const char *s="LINESTRING('3.584731 60.739211,3.590472 60.738030,3.592740 60.736220')";
  6. int n=0;
  7. double d;
  8. s=strchr(s,'\'')+1;
  9. while( 1==sscanf(s+=n,"%lf%*1[ ,]%n",&d,&n) )
  10. printf("\n%f",d);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2248KB
stdin
Standard input is empty
stdout
3.584731
60.739211
3.590472
60.738030
3.592740
60.736220