I want to compare to array. My problem is, that the first array is an array with this structure: 00d5ff4l
(a mac-address without colon).
The second array is from a buffer. His structure is 00 d5 ff 41
(Hex)
My current code looks like this
char mac[] = "00d5ff4l";
for (int i = 0; i < sizeof(mac); i++) {
if (mac[i] != other_array[i]) {
return 0;
}
else
return 1;
}
Now is the problem the following: Index 1 of mac is '0', but for other_array it's '00'. So it will never match in this way. Do i have to cast one of them? If yes, how?