fork download
  1. #include <stdlib.h>
  2. #include <stdio.h>
  3.  
  4. int main() {
  5. char* a = "\n";
  6. char* b = -1;
  7. printf("%d\n", b);
  8. int c = sscanf(a, "%m[^\n]%*c", &b);
  9. printf("%s %d %d\n", b, b, c);
  10. free(b);
  11. }
  12.  
Success #stdin #stdout 0s 1964KB
stdin
Standard input is empty
stdout
-1
(null) 0 0