728x90
static int strrncmp(const char* s1, const char* s2, int num) { int len1 = strlen(s1) - 1; int len2 = strlen(s2) - 1; for (; len1 >= 0 && len2 >= 0 && num > 0; len1--, len2--, num--) { const int d = (int)s1[len1] - (int)s2[len2]; if (d != 0) return d; } return 0; }
728x90
'프로그래밍' 카테고리의 다른 글
[ubuntu][ulimit] bash: ulimit: open files: cannot modify limit: Operation not permitted (0) | 2022.05.13 |
---|---|
[정보] C++ SIGCHLD, waitpid()에 관해서 (0) | 2021.11.26 |
linux 프로그램 실행 에러 (0) | 2013.06.24 |
popen() – execute shell command from C/C++ (0) | 2013.05.08 |
[CentOS] libmysqlclient.so.18: cannot open shared object file 실패 (0) | 2013.05.08 |
댓글