fork download
  1. #include <stdio.h>
  2. #include <string.h>
  3.  
  4. int main(void)
  5. {
  6. const char *test = "TEXT_2";
  7.  
  8. const char *ap[] = {
  9. "TEXT_1", "RESPONSE_1",
  10. "TEXT_2", "RESPONSE_2",
  11. NULL , NULL
  12. };
  13. const char **p = ap;
  14.  
  15. while (*p)
  16. {
  17. if (strcmp(test, *p) == 0)
  18. {
  19. printf("%s\n", *(p + 1));
  20. break;
  21. }
  22. p += 2;
  23. }
  24. return 0;
  25. }
Success #stdin #stdout 0s 5460KB
stdin
Standard input is empty
stdout
RESPONSE_2