编译时出现警告'<=':signed/unsigned mismatch strlen是一个无符号类型,当其与int型的a做比较,因为类型不同所以发出警告,此时把int a;改为size_t a;就可以了。