fork download
  1. #include <stdio.h>
  2.  
  3. int main(void)
  4. {
  5. int c = 0;
  6. int n = 0;
  7. char str[] = "30\0";
  8. int res = sscanf(str,"%d %n", &c, &n);
  9.  
  10. printf("c = %d\n", c);
  11. printf("n = %d\n", n);
  12. printf("res = %d\n", res);
  13.  
  14. return 0;
  15. }
  16.  
Success #stdin #stdout 0s 4268KB
stdin
Standard input is empty
stdout
c = 30
n = 2
res = 1