Hi
i have an array and wish to compare certain parts of the array to a string. For example i have the string "AB CD EF" and i want to test my string to see if it is of AB or CD or EF
this is what i have done but does not seem to work
any hints?Code:char temp[10]; char to_b_tested[10]; strncpy(temp, "AB CD EF", 8); if ((strncmp(temp[0], to_b_tested, 2) == 0) || (strncmp(temp[3], to_b_tested, 2) == 0) || (strncmp(temp[6], to_b_tested, 2) ==0)) { ;//then do something }