Name:
Anonymous
2009-06-25 0:32
suppose char *str has some bytes(not malloced), how can i determine the size of *str without access to str itself?
Name:
Anonymous
2009-06-25 0:50
~ >cat > test.c
#include <stdio.h>
int main()
{
char * str = "abc";
printf("%d\n",sizeof(str));
return 0;
}
~ >gcc test.c
~ >./a.out
4
~ >