How to write below code in C? Also: is there any built in function for checking length of an array?
Python Code
x = [\'ab\', \'bc\'
Something like this??
#include #include int main() { char *x[] = {"ab", "bc", "cd", 0}; char *s = "ab"; int i = 0; while(x[i]) { if(strcmp(x[i], s) == 0) { printf("Gotcha!\n"); break; } i++; } }