求字符串数组长度的一种方法

版权声明:本文为博主原创文章,未经博主允许不得转载。 https://blog.csdn.net/qq_40062917/article/details/86134072
#include <stdio.h>

struct string{
        char *st;
};

struct string test[] = { {"555555555"},{"111111"},{"0000"}};

int main()
{
        printf("%d\n",sizeof(test)/sizeof(struct string));
        return 0;
}

猜你喜欢

转载自blog.csdn.net/qq_40062917/article/details/86134072
今日推荐