When re-interpreting an ordinary char [] string with a single \0 at the end as an unsigned int [] array, there is almost no chance that at the end of such an unsigned int [] array you will see the trailing 0 . That is, if your comparison cycle does not find differences, then such a cycle will not stop at the end of the line, but will go beyond the limits of available memory and compare uninitialized and / or unstable values. Comparing unstable values leads to unstable and / or inconsistent comparison results, which leads to unspecified behavior, including the release of such an exception.
Reinterpretation of memory is almost always a dirty hack. But if you want to compare your lines in this way, then you need to ensure that at the end of each line there will be a null value of type unsigned int . For example, with sizeof(unsigned int) == 4 your lines should look like
const unsigned int* a[] { (const unsigned int*)"Сидоров\0\0\0\0\0\0", (const unsigned int*)"Петров\0\0\0\0\0\0", (const unsigned int*)"Иванов\0\0\0\0\0\0", (const unsigned int*)"Аров\0\0\0\0\0\0", (const unsigned int*)"Аро\0\0\0\0\0\0", (const unsigned int*)"\0\0\0\0\0\0", };
Those. in general (without adjusting to the length of a particular line) you need at least 7 zeros at the end of the line to ensure that re-interpreting this line as unsigned int [] will find a null value at the end.