strlen 和 sizeof 之区别
#include <stdio.h>
#include <string.h>
int main()
{
char mesg[] = "\0";
printf("strlen of mesg:%d\n",(int)strlen(mesg));
printf("sizeof mesg:%d\n",(int)sizeof(mesg)/(int)sizeof(char));
return 0;
}
#include <stdio.h>
#include <string.h>
int main()
{
char mesg[] = "\0";
printf("strlen of mesg:%d\n",(int)strlen(mesg));
printf("sizeof mesg:%d\n",(int)sizeof(mesg)/(int)sizeof(char));
return 0;
}