fork(1) download
  1. #include <stdio.h>
  2.  
  3. int main(void) {
  4. char a[50],b[50],c[50],d[50];
  5. int count = sscanf("phillip.allen@enron.com -> tim.belden@enron.com at 989883540", "%49[^@]@%49[^ ] -> %49[^@]@%49[^ ]", a, b, c, d);
  6. printf("Got %d items:\n", count);
  7. printf("'%s'\n", a);
  8. printf("'%s'\n", b);
  9. printf("'%s'\n", c);
  10. printf("'%s'\n", d);
  11. return 0;
  12. }
  13.  
Success #stdin #stdout 0s 2292KB
stdin
Standard input is empty
stdout
Got 4 items:
'phillip.allen'
'enron.com'
'tim.belden'
'enron.com'