Guest User

Untitled

a guest
Nov 17th, 2018
80
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.59 KB | None | 0 0
  1. int sscanf(char *s, const char *format, ...);
  2.  
  3. int scanf(const char *format, ...);
  4.  
  5. int idade, ano;
  6. char *s = (char *) malloc(100 * sizeof(char));
  7. s = "10 50";
  8. sscanf(s, "%d%d", &idade, &ano);
  9. printf("-> %sn", s);
  10. printf("-> idade: %d, ano: %d", idade, ano);
  11.  
  12. int sprintf(char *s, const char *format, ...);
  13.  
  14. int printf(const char *format, ...);
  15.  
  16. int idade, ano;
  17. char *s = (char *) malloc(100 * sizeof(char));
  18. char *t = (char *) malloc(100 * sizeof(char));
  19. s = "10 50";
  20. sscanf(s, "%d%d", &idade, &ano);
  21. printf("-> %sn", s);
  22. sprintf(t, "-> i: %d, a: %d", idade, ano);
  23. printf("-> t: %sn", t);
Add Comment
Please, Sign In to add comment