strlen是不是只能计算字符数组的长度,不能算int型数组
程序代码:
#include<stdio.h> #include<string.h> int main(int argc,const char *argv[]) { int a[] = {10}; int b; b = strlen(a); printf("%d",b); return 0; }
结果是[Error] cannot convert 'int*' to 'const char*' for argument '1' to 'size_t strlen(const char*)'