I have two char arrays of different lengths. I want to make sure that the first 256 elements are same.
I am using the following:
for (int i = 0; i < 256; i = i + 1) {
if (arr1[i] != arr2[i]) {
not_equal = 1;
}
}
Will this catch all cases of special characters etc.?
strncmp()ormemcmp()if you don't want the indexes of mismatch.