I'm not sure how fast the code is below. If anyone knows a faster / optimized code than this, please let me know.
int xstrcmp(char *s1, char *s2) { while (*s1 == *s2++) if (*s1++ == 0) return (0); return (*(const unsigned char *)s1 - *(const unsigned char *)(s2-1)); }
::strcmp . , , , , (, SSE4.2 ). MSVC , , ( ), VS2010, VC/crt/src/intel/strcmp.asm.)
::strcmp
VC/crt/src/intel/strcmp.asm
, , strcmp? C strcmp .
, :
if (a[0]==b[0] && strcmp(a, b)==0){.....
strcmp, , .
strcmp
Source: https://habr.com/ru/post/1674399/More articles:https://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1674394/point-dns-to-ssl-cname-heroku-godaddy&usg=ALkJrhgKwFTsEXdPIH3SO7Uoh-PgVe774wComparing two dicts in python - pythonWhy is the C ++ operator string == (equality) much faster than manually checking characters one by one? - c ++Checkbox does not return false angular 2 - checkboxИспользовать флаги -Xms и-Xms для ресурсов машины? - javaion-infinite scrolls for infinite callback - ionic-frameworkSwift libtinfo.so.5 no version information - linuxhttps://translate.googleusercontent.com/translate_c?depth=1&pto=aue&rurl=translate.google.com&sl=ru&sp=nmt4&tl=en&u=https://fooobar.com/questions/1674402/what-is-the-best-way-to-evenly-distribute-objects-to-fill-a-curved-space-in-unity-3d&usg=ALkJrhgBMlu4Opx66as6duBbMm6j23cCeABulk stop disk arrays without additional checks - pythonReact-router npm package give me warning in console? (PropTypes is deprecated) - javascriptAll Articles