fork download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. int i;
  5. char s[] = "This is a 345.454 test";
  6. char str[6][256];
  7. double f;
  8. sscanf(s,"%s %*s %*s %lf %s",str[0],&f,str[1]);
  9.  
  10. for( i=0; i<2; i++)
  11. printf("%s\n",str[i]);
  12. printf("%f",f);
  13. return 0;
  14. }
  15.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
This
test
345.454000