- 论坛徽章:
- 0
|
#include <stdlib.h>
#include <stdio.h>
#include <string.h>
char g_string1[]={'1','2','3'};
char g_string2[]={'x','y','z'};
int main(int argc,char* argv[])
{
char string1[]={'1','2','3'};
char string2[]={'x','y','z'};
printf("g_string1 length=%d.sizeof=%d.\n",strlen(g_string1),sizeof(g_string1));
printf("g_string2 length=%d.sizeof=%d.\n",strlen(g_string2),sizeof(g_string2));
printf("string1 length=%d.sizeof=%d.\n",strlen(string1),sizeof(string1));
printf("string2 length=%d.sizeof=%d.\n",strlen(string2),sizeof(string2));
return 0;
}
|
|