strlen如何求二维数组某一行的长度

2024-11-22 18:24:52
推荐回答(4个)
回答1:

char s[][100] = { "Hello", ",", "world", "!" };
for (int i=0; i printf("%d, %s\n", strlen(s[i]), s[i]);

回答2:

char str[2][] = {"abcdefg","hijiklmn"};

int i = strlen(str[0]); //i = 7
int j = strlen(str[1]);//j = 8

回答3:

如char str[3][3]
strlen(str[0])

回答4:

我想你其实不是问这个问题,LZ想问的是?