fork download
  1. #include <stdio.h>
  2. #include <stdint.h>
  3.  
  4. int main(void) {
  5.  
  6. static uint8_t data_array[20] = "ABC";
  7. static uint8_t s[4] = "ABC";
  8. static uint8_t length = 3;
  9.  
  10. uint8_t bool = 1;
  11. for (int i = 0; i < length; i++) {
  12. if (s[i] != data_array[i]) {
  13. bool = 0;
  14. break;
  15. }
  16. }
  17. if (bool) {
  18. printf("pattern found\n");
  19. }
  20. return 0;
  21. }
  22.  
Success #stdin #stdout 0s 2156KB
stdin
Standard input is empty
stdout
pattern found