fork(1) download
  1. #include <stdio.h>
  2. #include <string.h>
  3. #include <stdlib.h>
  4.  
  5. int main(void) {
  6. char *login = strdup("login/password"); // getInput возвращает сабжевую строку
  7. char *password = strchr(login, '/');
  8. if (! password) {
  9. fputs("Cannot parse", stderr);
  10. exit(EXIT_FAILURE);
  11. }
  12.  
  13. *password++ = '\0';
  14.  
  15. printf("login: %s\npassword: %s\n", login, password);
  16.  
  17. // your code goes here
  18. return 0;
  19. }
  20.  
Success #stdin #stdout 0s 2140KB
stdin
Standard input is empty
stdout
login: login
password: password